diff options
author | Sergey Ponomarev <stokito@gmail.com> | 2023-09-23 10:11:02 +0300 |
---|---|---|
committer | Sergey Ponomarev <stokito@gmail.com> | 2023-09-23 10:11:02 +0300 |
commit | 9d384a2140d0c5b3649477e993e72a9ed58a0ca6 (patch) | |
tree | 6682fcbcb1a4b8fd6d56bee9dc73794f13f29ad9 /modules/luci-base/htdocs/luci-static | |
parent | d7e905e83a11d59ea217cd37189040bd6c9d403e (diff) |
luci-base: cbi.js cbi_validate_named_section_add() simplify
Reduce if to a simple boolean evaluation
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 7 |
1 files changed, 1 insertions, 6 deletions
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) |