Remove dark theme when leaving the Dashboard app. Add dark theme for localNav. (#9032)

* Remove dark theme when leaving the Dashboard app.

* Upgrade kibana-ui-framework to 0.0.10: localNav dark theme styles.
This commit is contained in:
CJ Cenizal 2016-11-11 12:57:53 -08:00 committed by GitHub
parent 86cff9655b
commit deec2ebfe3
2 changed files with 10 additions and 4 deletions

View file

@ -72,7 +72,7 @@
"@bigfunger/decompress-zip": "0.2.0-stripfix3",
"@bigfunger/jsondiffpatch": "0.1.38-webpack",
"@elastic/datemath": "2.3.0",
"@elastic/kibana-ui-framework": "0.0.9",
"@elastic/kibana-ui-framework": "0.0.10",
"@spalger/filesaver": "1.1.2",
"@spalger/leaflet-draw": "0.2.3",
"@spalger/leaflet-heat": "0.1.3",

View file

@ -75,8 +75,6 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
}
}
$scope.$on('$destroy', dash.destroy);
const matchQueryFilter = function (filter) {
return filter.query && filter.query.query_string && !filter.meta;
};
@ -103,6 +101,7 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
$scope.$watchCollection('state.options', function (newVal, oldVal) {
if (!angular.equals(newVal, oldVal)) $state.save();
});
$scope.$watch('state.options.darkTheme', setDarkTheme);
$scope.topNavMenu = [{
@ -154,7 +153,14 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
stateMonitor.onChange((status) => {
$appStatus.dirty = status.dirty;
});
$scope.$on('$destroy', () => stateMonitor.destroy());
$scope.$on('$destroy', () => {
stateMonitor.destroy();
dash.destroy();
// Remove dark theme to keep it from affecting the appearance of other apps.
setDarkTheme(false);
});
$scope.$emit('application.load');
}