Skip to content

Commit

Permalink
Remove dark theme when leaving the Dashboard app.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Nov 10, 2016
1 parent 23141be commit 400ca26
Showing 1 changed file with 9 additions and 3 deletions.
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 400ca26

Please sign in to comment.