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>
This commit is contained in:
parent
d7e905e83a
commit
9d384a2140
1 changed files with 1 additions and 6 deletions
|
@ -370,12 +370,7 @@ function cbi_validate_form(form, errmsg)
|
||||||
function cbi_validate_named_section_add(input)
|
function cbi_validate_named_section_add(input)
|
||||||
{
|
{
|
||||||
var button = input.parentNode.parentNode.querySelector('.cbi-button-add');
|
var button = input.parentNode.parentNode.querySelector('.cbi-button-add');
|
||||||
if (input.value !== '') {
|
button.disabled = input.value === '';
|
||||||
button.disabled = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
button.disabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cbi_validate_reset(form)
|
function cbi_validate_reset(form)
|
||||||
|
|
Loading…
Reference in a new issue