Skip to content

Commit

Permalink
Remove dark theme when leaving the Dashboard app. Add dark theme for …
Browse files Browse the repository at this point in the history
…localNav. (#9032)

* Remove dark theme when leaving the Dashboard app.

* Upgrade kibana-ui-framework to 0.0.10: localNav dark theme styles.
  • Loading branch information
cjcenizal committed Nov 11, 2016
1 parent 86cff96 commit deec2eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 9 additions & 3 deletions src/core_plugins/kibana/public/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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 = [{
Expand Down Expand Up @@ -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');
}
Expand Down

0 comments on commit deec2eb

Please sign in to comment.