diff options
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources/cbi.js')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 81cc657784..8bf94a6c50 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -506,10 +506,11 @@ function cbi_init() { var nodes = document.querySelectorAll('[data-depends]'); for (var i = 0, node; (node = nodes[i]) !== undefined; i++) { - var deps = JSON.parse(node.getAttribute('data-depends')); - if (deps.length > 0) { - for (var alt = 0; alt < deps.length; alt++) { - cbi_d_add(node, deps[alt], i); + var index = parseInt(node.getAttribute('data-index'), 10); + var depends = JSON.parse(node.getAttribute('data-depends')); + if (!isNaN(index) && depends.length > 0) { + for (var alt = 0; alt < depends.length; alt++) { + cbi_d_add(node, depends[alt], index); } } } |