Skip to content

Commit

Permalink
[Timepicker] fixing the auto refresh so it works properly, moved the …
Browse files Browse the repository at this point in the history
…timepicker file
  • Loading branch information
panda01 committed Mar 24, 2016
1 parent cabec73 commit 1e395bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import UiModules from 'ui/modules';
import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls';
import { once, clone } from 'lodash';

import toggleHtml from './toggle.html';
import toggleHtml from './kbn_global_timepicker.html';

UiModules
.get('kibana')
.directive('kbnGlobalTimepicker', (timefilter, globalState) => {
.directive('kbnGlobalTimepicker', (timefilter, globalState, $rootScope) => {
const listenForUpdates = once($scope => {
$scope.$listen(timefilter, 'update', (newVal, oldVal) => {
globalState.time = clone(timefilter.time);
Expand All @@ -18,10 +18,10 @@ UiModules
return {
template: toggleHtml,
link: ($scope, $el, attrs) => {
listenForUpdates($scope);
listenForUpdates($rootScope);

$scope.timefilter = timefilter;
$scope.toggleRefresh = () => {
$rootScope.timefilter = timefilter;
$rootScope.toggleRefresh = () => {
timefilter.refreshInterval.pause = !timefilter.refreshInterval.pause;
};
},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/timepicker/timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'ui/directives/inequality';
import 'ui/timepicker/quick_ranges';
import 'ui/timepicker/refresh_intervals';
import 'ui/timepicker/time_units';
import 'ui/timepicker/toggle';
import 'ui/timepicker/kbn_global_timepicker';
import uiModules from 'ui/modules';
var module = uiModules.get('ui/timepicker');
var notify = new Notifier({
Expand Down

0 comments on commit 1e395bf

Please sign in to comment.