Commit 7a53bcd7 by Rashid Khan

Merge pull request #273 from rashidkpc/master

closes #264
parents 56862f8e 05b15c46
...@@ -75,7 +75,13 @@ angular.module('kibana.timepicker', []) ...@@ -75,7 +75,13 @@ angular.module('kibana.timepicker', [])
// These 3 statements basicly do everything time_apply() does // These 3 statements basicly do everything time_apply() does
set_timepicker($scope.time.from,$scope.time.to); set_timepicker($scope.time.from,$scope.time.to);
update_panel(); update_panel();
// If we're in a mode where something must be calculated, clear existing filters
// and set new ones
if($scope.panel.mode !== 'absolute') {
set_time_filter($scope.time); set_time_filter($scope.time);
}
dashboard.refresh(); dashboard.refresh();
...@@ -224,15 +230,9 @@ angular.module('kibana.timepicker', []) ...@@ -224,15 +230,9 @@ angular.module('kibana.timepicker', [])
function set_time_filter(time) { function set_time_filter(time) {
time.type = 'time'; time.type = 'time';
// Check if there's a time filter we remember, if not, set one and remember it // Clear all time filters, set a new one
if(!_.isUndefined($scope.panel.filter_id) && filterSrv.removeByType('time');
!_.isUndefined(filterSrv.list[$scope.panel.filter_id]) &&
filterSrv.list[$scope.panel.filter_id].type === 'time')
{
filterSrv.set(compile_time(time),$scope.panel.filter_id);
} else {
$scope.panel.filter_id = filterSrv.set(compile_time(time)); $scope.panel.filter_id = filterSrv.set(compile_time(time));
}
return $scope.panel.filter_id; return $scope.panel.filter_id;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment