Skip to content

Commit

Permalink
[Minor] WebUI: enable scan button on page load
Browse files Browse the repository at this point in the history
if the text area is non-empty
  • Loading branch information
moisseev committed Aug 31, 2019
1 parent 10dcd62 commit 85c8368
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions interface/js/app/upload.js
Expand Up @@ -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("");
Expand Down

0 comments on commit 85c8368

Please sign in to comment.