summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2016-02-10 18:23:39 +0100
committerJo-Philipp Wich <jow@openwrt.org>2016-02-10 18:23:39 +0100
commit58e2f557da49e5acb1d4395a9698b1953f1586c3 (patch)
tree4eb77ecbfc7c8e3f053f884102286da19779dd5a /modules
parentf33695d456fa92d71fc7fc6483af1a45ee906d62 (diff)
luci-base: cbi: only spawn dynlist sub-comboboxes if choices are available
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index b27c56492..a1491cc66 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js
@@ -550,10 +550,14 @@ function cbi_init() {
for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
var choices = JSON.parse(node.getAttribute('data-dynlist'));
- var options = {};
+ var options = null;
- for (var j = 0; j < choices[0].length; j++)
- options[choices[0][j]] = choices[1][j];
+ if (choices[0] && choices[0].length) {
+ options = {};
+
+ for (var j = 0; j < choices[0].length; j++)
+ options[choices[0][j]] = choices[1][j];
+ }
cbi_dynlist_init(node, choices[2], choices[3], options);
}