luci-base: cbi.js: fix dropdown and browser initialization
We need to query the dropdowns before initializing dynamic lists but
after initializing combo boxes.
Also fix a copy-paste error from a previous commit.
Fixes: 010102c2c
("luci-base: cbi.js: find dropdown and browser instances early")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
7513a4ca35
commit
c0f3e3c6a2
1 changed files with 5 additions and 4 deletions
|
@ -736,9 +736,7 @@ function cbi_d_update() {
|
|||
}
|
||||
|
||||
function cbi_init() {
|
||||
var dropdowns = document.querySelectorAll('.cbi-dropdown'),
|
||||
browsers = document.querySelectorAll('[data-browser]'),
|
||||
nodes;
|
||||
var dropdowns, browsers, nodes;
|
||||
|
||||
nodes = document.querySelectorAll('[data-strings]');
|
||||
|
||||
|
@ -787,6 +785,9 @@ function cbi_init() {
|
|||
node.getAttribute('data-manual'));
|
||||
}
|
||||
|
||||
dropdowns = document.querySelectorAll('.cbi-dropdown');
|
||||
browsers = document.querySelectorAll('[data-browser]');
|
||||
|
||||
nodes = document.querySelectorAll('[data-dynlist]');
|
||||
|
||||
for (var i = 0, node; (node = nodes[i]) !== undefined; i++) {
|
||||
|
@ -811,7 +812,7 @@ function cbi_init() {
|
|||
}
|
||||
|
||||
dropdowns.forEach(cbi_dropdown_init);
|
||||
browsers.querySelectorAll('[data-browser]').forEach(cbi_browser_init);
|
||||
browsers.forEach(cbi_browser_init);
|
||||
|
||||
document.querySelectorAll('.cbi-tooltip:not(:empty)').forEach(function(s) {
|
||||
s.parentNode.classList.add('cbi-tooltip-container');
|
||||
|
|
Loading…
Reference in a new issue