Skip to content

Commit

Permalink
Bug fix and clean up dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
stacey-gammon committed Jan 19, 2017
1 parent 6769459 commit c5265f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/core_plugins/kibana/public/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,12 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,

$scope.$watch('state.options.darkTheme', setDarkTheme);

$scope.queryEdited = () => $scope.dashboardViewMode === DashboardViewMode.EDIT && !_.isEqual($state.query, savedDashQuery);

// A hashkey in the filter array will ruin our comparison, so we need to get rid of it.
const cleanFiltersForComparison = (filters) => _.map(filters, (filter) => _.omit(filter, '$$hashKey'));
const filterMismatch = () =>
!_.isEqual(cleanFiltersForComparison($state.filters), cleanFiltersForComparison(savedDashFilters)) ||
!_.isEqual($state.query, savedDashQuery);

const timeMismatch = () => savedDashTimeFrom !== timefilter.time.from || savedDashTimeTo !== timefilter.time.to;

const changeViewMode = (newMode) => {
Expand Down Expand Up @@ -153,7 +152,7 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter,
noop,
'Save dashboard',
'Lose changes',
'Warning');
'Unsaved changes');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/kbn_top_nav/kbn_top_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ module.directive('kbnTopNav', function (Private) {

const getTopNavConfig = () => _.get($scope, $attrs.config, []);

$scope.$watch(getTopNavConfig, initTopNavForConfigChanges);
$scope.$watch(getTopNavConfig, initTopNavForConfigChanges, true);

initTopNavForConfigChanges(getTopNavConfig(), null);
return $scope.kbnTopNav;
Expand Down

0 comments on commit c5265f7

Please sign in to comment.