mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
update vis icon on save
This commit is contained in:
parent
ec9a614d70
commit
401ed70df6
2 changed files with 8 additions and 0 deletions
|
@ -47,6 +47,13 @@ module.directive('vislibSeries', function ($parse, $compile) {
|
|||
});
|
||||
$scope.vis.params.seriesParams = $scope.vis.params.seriesParams.slice(0, serieCount);
|
||||
});
|
||||
|
||||
$scope.$watch(() => {
|
||||
return $scope.vis.params.seriesParams.map(series => series.type).join();
|
||||
}, () => {
|
||||
const types = _.uniq(_.map($scope.vis.params.seriesParams, 'type'));
|
||||
$scope.savedVis.type = types.length === 1 ? types[0] : 'histogram';
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -293,6 +293,7 @@ function VisEditor($scope, $route, timefilter, AppState, $window, kbnUrl, courie
|
|||
$scope.doSave = function () {
|
||||
// vis.title was not bound and it's needed to reflect title into visState
|
||||
$state.vis.title = savedVis.title;
|
||||
$state.vis.type = savedVis.type || $state.vis.type;
|
||||
savedVis.visState = $state.vis;
|
||||
savedVis.uiStateJSON = angular.toJson($scope.uiState.getChanges());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue