]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Remove previously-attached event handlers
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 21 Jul 2018 15:54:23 +0000 (18:54 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 21 Jul 2018 15:54:23 +0000 (18:54 +0300)
from save buttons on the "Symbols" tab

interface/js/app/symbols.js

index 75234b09e390bbac2d2b478810c9610bcb1d4a85..548411a6a486480e7dc5b26f4fc5010c6e3ee6c4 100644 (file)
@@ -250,11 +250,13 @@ define(["jquery", "footable"],
                     rspamd.alertMessage("alert-modal alert-error", data.statusText);
                 }
             });
-            $(document).on("click", "#symbolsTable :button", function () {
-                var value = $(this).data("save");
-                if (!value) return;
-                saveSymbols(rspamd, "./savesymbols", "symbolsTable", value === "cluster");
-            });
+            $("#symbolsTable")
+                .off("click", ":button")
+                .on("click", ":button", function () {
+                    var value = $(this).data("save");
+                    if (!value) return;
+                    saveSymbols(rspamd, "./savesymbols", "symbolsTable", value === "cluster");
+                });
         };
 
         ui.setup = function (rspamd) {