From d719f6821b4ce75f15bcd5bdd9921c86acbd1207 Mon Sep 17 00:00:00 2001 From: moisseev Date: Sun, 3 Dec 2023 19:59:17 +0300 Subject: [PATCH] [WebUI] Update symbols score background on input --- interface/js/app/symbols.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js index fdc31f3e6..3db704562 100644 --- a/interface/js/app/symbols.js +++ b/interface/js/app/symbols.js @@ -75,7 +75,7 @@ define(["jquery", "app/rspamd", "footable"], } else if (item.weight > 0) { label_class = "scorebar-spam"; } - item.weight = ''; if (!item.time) { @@ -232,6 +232,15 @@ define(["jquery", "app/rspamd", "footable"], const value = $(this).data("save"); if (!value) return; saveSymbols("./savesymbols", "symbolsTable", value); + }) + .on("input", ".scorebar", ({target}) => { + const t = $(target); + t.removeClass("scorebar-ham scorebar-spam"); + if (target.value < 0) { + t.addClass("scorebar-ham"); + } else if (target.value > 0) { + t.addClass("scorebar-spam"); + } }); }; -- 2.39.5