From: Sergey Ponomarev Date: Sat, 23 Sep 2023 07:11:02 +0000 (+0300) Subject: luci-base: cbi.js cbi_validate_named_section_add() simplify X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=9d384a2140d0c5b3649477e993e72a9ed58a0ca6;p=openwrt-luci.git luci-base: cbi.js cbi_validate_named_section_add() simplify Reduce if to a simple boolean evaluation Signed-off-by: Sergey Ponomarev --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 3fc6edf29f..38687a1cef 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -370,12 +370,7 @@ function cbi_validate_form(form, errmsg) function cbi_validate_named_section_add(input) { var button = input.parentNode.parentNode.querySelector('.cbi-button-add'); - if (input.value !== '') { - button.disabled = false; - } - else { - button.disabled = true; - } + button.disabled = input.value === ''; } function cbi_validate_reset(form)