Reduce condition complexity
This commit is contained in:
parent
e206dd527e
commit
a3c45f6ed6
6 changed files with 31 additions and 64 deletions
|
@ -61,13 +61,9 @@ OSM.Changeset = function (map) {
|
|||
});
|
||||
|
||||
content.find("textarea").on("input", function (e) {
|
||||
var form = e.target.form;
|
||||
|
||||
if ($(e.target).val() === "") {
|
||||
$(form.comment).prop("disabled", true);
|
||||
} else {
|
||||
$(form.comment).prop("disabled", false);
|
||||
}
|
||||
const form = e.target.form,
|
||||
disabled = $(e.target).val() === "";
|
||||
form.comment.disabled = disabled;
|
||||
});
|
||||
|
||||
content.find("textarea").val("").trigger("input");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue