luci-base: cbi: only spawn dynlist sub-comboboxes if choices are available
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
f33695d456
commit
58e2f557da
1 changed files with 7 additions and 3 deletions
|
@ -550,10 +550,14 @@ function cbi_init() {
|
||||||
|
|
||||||
for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
|
for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
|
||||||
var choices = JSON.parse(node.getAttribute('data-dynlist'));
|
var choices = JSON.parse(node.getAttribute('data-dynlist'));
|
||||||
var options = {};
|
var options = null;
|
||||||
|
|
||||||
for (var j = 0; j < choices[0].length; j++)
|
if (choices[0] && choices[0].length) {
|
||||||
options[choices[0][j]] = choices[1][j];
|
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);
|
cbi_dynlist_init(node, choices[2], choices[3], options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue