aboutsummaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2016-12-23 13:07:17 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2016-12-23 13:07:17 +0300
commitc326da2c45ae7165eebc268a208abb8e9c40fc44 (patch)
treece1d9087f4914f26542d75a0642fdedb35e02a5f /interface
parent1b4ebd17edea6d8d84ca9e1cbc3b98c9068fef58 (diff)
downloadrspamd-c326da2c45ae7165eebc268a208abb8e9c40fc44.tar.gz
rspamd-c326da2c45ae7165eebc268a208abb8e9c40fc44.zip
[WebUI] Prevent multiple clicks on `Refresh`
Diffstat (limited to 'interface')
-rw-r--r--interface/js/rspamd.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js
index 38cb0ed13..e5f37e6df 100644
--- a/interface/js/rspamd.js
+++ b/interface/js/rspamd.js
@@ -76,10 +76,18 @@
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() {