fixes error with saving hidden metrics (#10220)

* fixing pie chart tooltip custom label bug

* fixing the bug thomas found
This commit is contained in:
Peter Pisljar 2017-02-16 09:13:43 +01:00 committed by GitHub
parent e2cd8ee191
commit 686a70944e

View file

@ -142,6 +142,16 @@ uiModules
applyClassNames();
});
function updateVisAggs() {
const enabledState = $scope.editableVis.getEnabledState();
const shouldUpdate = enabledState.aggs.length !== $scope.vis.aggs.length;
if (shouldUpdate) {
$scope.vis.setState(enabledState);
$scope.editableVis.dirty = false;
}
}
$scope.$watch('vis', prereq(function (vis, oldVis) {
const $visEl = getVisEl();
if (!$visEl) return;
@ -157,6 +167,7 @@ uiModules
}));
$scope.$watchCollection('vis.params', prereq(function () {
updateVisAggs();
if ($scope.renderbot) $scope.renderbot.updateParams();
}));