From: Alexander Moisseev Date: Fri, 23 Dec 2016 10:07:17 +0000 (+0300) Subject: [WebUI] Prevent multiple clicks on `Refresh` X-Git-Tag: 1.5.0~494^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1280%2Fhead;p=thirdparty%2Frspamd.git [WebUI] Prevent multiple clicks on `Refresh` --- diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 38cb0ed132..e5f37e6dff 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() {