diff options
author | moisseev <moiseev@mezonplus.ru> | 2023-12-03 19:59:17 +0300 |
---|---|---|
committer | moisseev <moiseev@mezonplus.ru> | 2023-12-03 19:59:17 +0300 |
commit | d719f6821b4ce75f15bcd5bdd9921c86acbd1207 (patch) | |
tree | 510c8e62652f047af2fbefbf3c705dc15f91d945 /interface | |
parent | 28cc2ed5fb4ed26649d4fa2f8eae25a3449f6b5a (diff) | |
download | rspamd-d719f6821b4ce75f15bcd5bdd9921c86acbd1207.tar.gz rspamd-d719f6821b4ce75f15bcd5bdd9921c86acbd1207.zip |
[WebUI] Update symbols score background on input
Diffstat (limited to 'interface')
-rw-r--r-- | interface/js/app/symbols.js | 11 |
1 files changed, 10 insertions, 1 deletions
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 = '<input class="form-control input-sm mb-disabled ' + label_class + + item.weight = '<input class="form-control input-sm mb-disabled scorebar ' + label_class + '" data-role="numerictextbox" autocomplete="off" type="number" step="0.01" tabindex="1" ' + 'value="' + formatter.format(item.weight) + '" id="_sym_' + item.symbol + '"></input>'; 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"); + } }); }; |