From 9d384a2140d0c5b3649477e993e72a9ed58a0ca6 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Sat, 23 Sep 2023 10:11:02 +0300 Subject: [PATCH] luci-base: cbi.js cbi_validate_named_section_add() simplify Reduce if to a simple boolean evaluation Signed-off-by: Sergey Ponomarev --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 7 +------ 1 file changed, 1 insertion(+), 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) -- 2.30.2