aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2019-08-31 11:20:26 +0300
committermoisseev <moiseev@mezonplus.ru>2019-08-31 11:20:26 +0300
commit85c8368a2b41be577a2c626204c3238e8105d0b1 (patch)
tree094177d17d460a85474f165b208f569eba8fbeb9 /interface/js/app
parent10dcd6236aa3a7576bc81885cbcf668cdca0b293 (diff)
downloadrspamd-85c8368a2b41be577a2c626204c3238e8105d0b1.tar.gz
rspamd-85c8368a2b41be577a2c626204c3238e8105d0b1.zip
[Minor] WebUI: enable scan button on page load
if the text area is non-empty
Diffstat (limited to 'interface/js/app')
-rw-r--r--interface/js/app/upload.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js
index 0a0640c51..39a86fd69 100644
--- a/interface/js/app/upload.js
+++ b/interface/js/app/upload.js
@@ -195,12 +195,15 @@ define(["jquery"],
rspamd.destroyTable("scan");
rspamd.symbols.scan.length = 0;
});
- $("#scan button").attr("disabled", true);
+
+ function enable_disable_scan_btn() {
+ $("#scan button").prop("disabled", ($.trim($("textarea").val()).length === 0));
+ }
+ enable_disable_scan_btn();
$("textarea").on("input", function () {
- var $this = $(this);
- $("#scan button")
- .prop("disabled", ($.trim($this.val()).length === 0));
+ enable_disable_scan_btn();
});
+
$("#scanClean").on("click", function () {
$("#scan button").attr("disabled", true);
$("#scanMsgSource").val("");