diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-09-22 20:23:50 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-09-22 20:28:25 +0300 |
commit | 7515ed4a1692ca5d64985505781fd3e2b46c9294 (patch) | |
tree | 8f5617be0d7bea39bb27c55797d4d9c7a942eed9 /interface/js/app | |
parent | a9ef733f69c24eba8599c85a5486637d3bda4317 (diff) | |
download | rspamd-7515ed4a1692ca5d64985505781fd3e2b46c9294.tar.gz rspamd-7515ed4a1692ca5d64985505781fd3e2b46c9294.zip |
[WebUI] Fix upload buttons disabling
Diffstat (limited to 'interface/js/app')
-rw-r--r-- | interface/js/app/upload.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js index 94659b740..f5a5cf73f 100644 --- a/interface/js/app/upload.js +++ b/interface/js/app/upload.js @@ -149,12 +149,10 @@ define(["jquery"], return e.options[e.selectedIndex].value; } - $("textarea").change(function () { - if ($(this).val().length !== "") { - $(this).closest("form").find("button").removeAttr("disabled").removeClass("disabled"); - } else { - $(this).closest("form").find("button").attr("disabled").addClass("disabled"); - } + $("textarea").keyup(function () { + var $this = $(this); + $this.closest("form").find("button") + .prop("disabled", ($.trim($this.val()).length === 0)); }); $("#scanClean").on("click", function () { @@ -174,7 +172,7 @@ define(["jquery"], weight: $("#fuzzyWeightText").val() } : {}; - if (data.length > 0) { + if ($.trim(data).length > 0) { if (source === "scan") { var checked_server = getSelector("selSrv"); var server = (checked_server === "All SERVERS") ? "local" : checked_server; |