diff options
author | Jian Chang <aa65535@live.com> | 2017-01-03 19:00:53 +0800 |
---|---|---|
committer | Jian Chang <aa65535@live.com> | 2017-01-03 19:00:53 +0800 |
commit | 260a24aadbac1e700aa3779785f04425dd0e63d1 (patch) | |
tree | 9bc3e4e21540a545fa52523e86306ea7461d5388 /modules/luci-base/htdocs/luci-static/resources | |
parent | 953d2814c8e61c7b8eacd6daeb54f6affb0e85ee (diff) |
luci-base:adjust the code order
The `cbi_validate_field` should be after data initialized.
Signed-off-by: Jian Chang <aa65535@live.com>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 5790e303dd..0ca7e264a7 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -523,13 +523,6 @@ function cbi_init() { } } - nodes = document.querySelectorAll('[data-type]'); - - for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { - cbi_validate_field(node, node.getAttribute('data-optional') === 'true', - node.getAttribute('data-type')); - } - nodes = document.querySelectorAll('[data-choices]'); for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { @@ -562,6 +555,13 @@ function cbi_init() { cbi_dynlist_init(node, choices[2], choices[3], options); } + nodes = document.querySelectorAll('[data-type]'); + + for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { + cbi_validate_field(node, node.getAttribute('data-optional') === 'true', + node.getAttribute('data-type')); + } + cbi_d_update(); } |