aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app/upload.js
diff options
context:
space:
mode:
Diffstat (limited to 'interface/js/app/upload.js')
-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("");