Author: timopollmeier
Date: 2016-09-22 16:01:51 +0200 (Thu, 22 Sep 2016)
New Revision: 26263

Modified:
   trunk/gsa/ChangeLog
   trunk/gsa/src/html/classic/js/greenbone.js
   trunk/gsa/src/html/classic/js/gsa_dashboard.js
Log:
        * 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.
        (stop_auto_refresh): Add to gsa object.

        * src/html/classic/js/gsa_dashboard.js (Dashboard.prototype.startEdit):
        Stop the auto-refresh on starting edit mode.
        (Dashboard.prototype.stopEdit): Start the auto-refresh on stopping
        edit mode.

Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog 2016-09-22 12:57:24 UTC (rev 26262)
+++ trunk/gsa/ChangeLog 2016-09-22 14:01:51 UTC (rev 26263)
@@ -1,3 +1,15 @@
+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.
+       (stop_auto_refresh): Add to gsa object.
+
+       * src/html/classic/js/gsa_dashboard.js (Dashboard.prototype.startEdit):
+       Stop the auto-refresh on starting edit mode.
+       (Dashboard.prototype.stopEdit): Start the auto-refresh on stopping
+       edit mode.
+
 2016-09-22  Matthew Mundell <matthew.mund...@greenbone.net>
 
        * CMakeLists.txt: Allow OPENVAS_RUN_DIR to be passed in.

Modified: trunk/gsa/src/html/classic/js/greenbone.js
===================================================================
--- trunk/gsa/src/html/classic/js/greenbone.js  2016-09-22 12:57:24 UTC (rev 
26262)
+++ trunk/gsa/src/html/classic/js/greenbone.js  2016-09-22 14:01:51 UTC (rev 
26263)
@@ -75,6 +75,8 @@
   gsa.log = {};
   gsa.for_each = for_each;
   gsa.upper_case_first = upper_case_first;
+  gsa.start_auto_refresh = start_auto_refresh;
+  gsa.stop_auto_refresh = stop_auto_refresh;
 
   gsa.log.error =  function() {
     console.error.apply(console, arguments);
@@ -1883,6 +1885,12 @@
       // Still open dialogs.
       return;
     }
+
+    if ($(document).find('.dashboard.edit').length > 0) {
+      // Dashboard(s) in edit mode.
+      return;
+    }
+
     if (!timeout_id && +localStorage.getItem('autorefresh-interval') &&
         global.autorefresh_enabled) {
       timeout_id = global.setTimeout(function() {

Modified: trunk/gsa/src/html/classic/js/gsa_dashboard.js
===================================================================
--- trunk/gsa/src/html/classic/js/gsa_dashboard.js      2016-09-22 12:57:24 UTC 
(rev 26262)
+++ trunk/gsa/src/html/classic/js/gsa_dashboard.js      2016-09-22 14:01:51 UTC 
(rev 26263)
@@ -359,6 +359,7 @@
         event.preventDefault();
       }
     });
+    gsa.stop_auto_refresh();
 
     return this;
   };
@@ -392,6 +393,7 @@
     }
 
     $(window).off('keydown'); // remove event listener
+    gsa.start_auto_refresh();
 
     return this;
   };

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

Reply via email to