Ver Fonte

Closes #282, Disable auto refresh zooming in (every time you change to an absolute time range), refresh will be restored when you change time range back to relative

Torkel Ödegaard há 11 anos atrás
pai
commit
541baac49e
2 ficheiros alterados com 11 adições e 0 exclusões
  1. 1 0
      CHANGELOG.md
  2. 10 0
      src/app/services/filterSrv.js

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@
 - Correction to ms axis formater, now formats days correctly. (Issue #189)
 - Css fix for Firefox and using top menu dropdowns in panel fullscren / edit mode (Issue #106)
 - Browser page title is now Grafana - {{dashboard title}} (Issue #294)
+- Disable auto refresh zooming in (every time you change to an absolute time range), refresh will be restored when you change time range back to relative (Issue #282)
 - More graphite functions
 
 # 1.5.2 (2014-03-24)

+ 10 - 0
src/app/services/filterSrv.js

@@ -87,6 +87,16 @@ define([
     this.setTime = function(time) {
       _.extend(self.time, time);
 
+      // disable refresh if we have an absolute time
+      if (time.to !== 'now') {
+        self.old_refresh = dashboard.current.refresh;
+        dashboard.set_interval(false);
+      }
+      else if (self.old_refresh && self.old_refresh !== dashboard.current.refresh) {
+        dashboard.set_interval(self.old_refresh);
+        self.old_refresh = null;
+      }
+
       $timeout(function(){
         dashboard.refresh();
       },0);