]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Prevent multiple clicks on `Refresh` 1280/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 23 Dec 2016 10:07:17 +0000 (13:07 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 23 Dec 2016 10:07:17 +0000 (13:07 +0300)
interface/js/rspamd.js

index 38cb0ed13246a0d134376f751824173fe4cc11fa..e5f37e6dfff2080257478d3183dd0c2232e1e5ab 100644 (file)
             return false;
         });
         $('#refresh').on('click', function (event) {
-            clearTimeout(stat_timeout);
-            getChart();
-            getGraphData(selected.selData);
-            statWidgets();
+            if (!$(this).attr('disabled')) {
+                $(this).attr('disabled', true);
+                clearTimeout(stat_timeout);
+
+                getChart();
+                getGraphData(selected.selData);
+                statWidgets();
+
+                setTimeout(function () {
+                    $('#refresh').removeAttr('disabled');
+                }, 1000);
+            }
         });
         // @supports session storage
         function supportsSessionStorage() {