From 7515ed4a1692ca5d64985505781fd3e2b46c9294 Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Sat, 22 Sep 2018 20:23:50 +0300 Subject: [PATCH] [WebUI] Fix upload buttons disabling --- interface/index.html | 6 +++--- interface/js/app/upload.js | 12 +++++------- 2 files changed, 8 insertions(+), 10 deletions(-) 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; -- 2.39.5