git.99rst.org
/
openwrt-luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
d7e905e
)
luci-base: cbi.js cbi_validate_named_section_add() simplify
author
Sergey Ponomarev
<redacted>
Sat, 23 Sep 2023 07:11:02 +0000
(10:11 +0300)
committer
Sergey Ponomarev
<redacted>
Sat, 23 Sep 2023 07:11:02 +0000
(10:11 +0300)
Reduce if to a simple boolean evaluation
Signed-off-by: Sergey Ponomarev <redacted>
modules/luci-base/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/cbi.js
b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 3fc6edf29fad77395c8666ac55528614d2ab7edd..38687a1cef69e52fbb293e1faa75051f4f11dec7 100644
(file)
--- 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)
git clone https://git.99rst.org/PROJECT