]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] WebUI: enable scan button on page load 3024/head
authormoisseev <moiseev@mezonplus.ru>
Sat, 31 Aug 2019 08:20:26 +0000 (11:20 +0300)
committermoisseev <moiseev@mezonplus.ru>
Sat, 31 Aug 2019 08:20:26 +0000 (11:20 +0300)
if the text area is non-empty

interface/js/app/upload.js

index 0a0640c519e13c25e5d131b55aa652b8eb167f54..39a86fd697da7f76e33443943a792e22df9e5d35 100644 (file)
@@ -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("");