Author: timopollmeier
Date: 2016-09-22 17:18:56 +0200 (Thu, 22 Sep 2016)
New Revision: 26264

Modified:
   trunk/gsa/ChangeLog
   trunk/gsa/src/html/classic/js/greenbone.js
Log:
        * src/html/classic/js/greenbone.js (start_auto_refresh)
        (stop_auto_refresh): Replace conditions for keeping the auto-refresh
        stopped with a counter.

Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog 2016-09-22 14:01:51 UTC (rev 26263)
+++ trunk/gsa/ChangeLog 2016-09-22 15:18:56 UTC (rev 26264)
@@ -1,5 +1,11 @@
 2016-09-22  Timo Pollmeier <timo.pollme...@greenbone.net>
 
+       * src/html/classic/js/greenbone.js (start_auto_refresh)
+       (stop_auto_refresh): Replace conditions for keeping the auto-refresh
+       stopped with a counter.
+
+2016-09-22  Timo Pollmeier <timo.pollme...@greenbone.net>
+
        * src/html/classic/js/greenbone.js (start_auto_refresh): Add to gsa
        object and do not start auto-refresh as long a dashboard is in edit
        mode.

Modified: trunk/gsa/src/html/classic/js/greenbone.js
===================================================================
--- trunk/gsa/src/html/classic/js/greenbone.js  2016-09-22 14:01:51 UTC (rev 
26263)
+++ trunk/gsa/src/html/classic/js/greenbone.js  2016-09-22 15:18:56 UTC (rev 
26264)
@@ -1879,10 +1879,15 @@
   }
 
   var timeout_id;
+  var auto_refresh_stop_counter = 0;
 
   function start_auto_refresh() {
-    if ($('.dialog-form').length > 0) {
-      // Still open dialogs.
+    if (auto_refresh_stop_counter > 0) {
+      auto_refresh_stop_counter --;
+    }
+
+    if (auto_refresh_stop_counter >= 1) {
+      // Still open dialogs, edit mode dashboards, etc.
       return;
     }
 
@@ -1900,6 +1905,8 @@
   }
 
   function stop_auto_refresh() {
+    auto_refresh_stop_counter ++;
+
     if (timeout_id !== undefined) {
       clearTimeout(timeout_id);
       timeout_id = undefined;

_______________________________________________
Openvas-commits mailing list
Openvas-commits@wald.intevation.org
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-commits

Reply via email to