From: Alexander Moisseev Date: Sat, 22 Sep 2018 17:23:50 +0000 (+0300) Subject: [WebUI] Fix upload buttons disabling X-Git-Tag: 1.8.0~22^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7515ed4a1692ca5d64985505781fd3e2b46c9294;p=rspamd.git [WebUI] Fix upload buttons disabling --- diff --git a/interface/index.html b/interface/index.html index 0d6f95064..6eebef1d4 100644 --- a/interface/index.html +++ b/interface/index.html @@ -212,12 +212,12 @@
Insert raw SPAM source:
-

+

Insert raw HAM source:
-

+

@@ -240,7 +240,7 @@
-

+

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;