luci-base: cbi.js: also initialize comboxes embedded in dynlists
Fixes: #3062
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
2a143f4777
commit
a357352453
1 changed files with 7 additions and 0 deletions
|
@ -802,6 +802,8 @@ function cbi_init() {
|
|||
}
|
||||
|
||||
cbi_dynlist_init(node, choices[2], choices[3], options);
|
||||
|
||||
node.querySelectorAll('.cbi-dropdown').forEach(cbi_dropdown_init);
|
||||
}
|
||||
|
||||
nodes = document.querySelectorAll('[data-type]');
|
||||
|
@ -1954,6 +1956,9 @@ function cbi_dropdown_init(sb) {
|
|||
if (!(this instanceof cbi_dropdown_init))
|
||||
return new cbi_dropdown_init(sb);
|
||||
|
||||
if (sb.classList.contains('initialized'))
|
||||
return;
|
||||
|
||||
this.multi = sb.hasAttribute('multiple');
|
||||
this.optional = sb.hasAttribute('optional');
|
||||
this.placeholder = sb.getAttribute('placeholder') || '---';
|
||||
|
@ -2049,6 +2054,8 @@ function cbi_dropdown_init(sb) {
|
|||
li.setAttribute('unselectable', '');
|
||||
li.addEventListener('click', this.handleCreateClick.bind(this));
|
||||
}
|
||||
|
||||
sb.classList.add('initialized');
|
||||
}
|
||||
|
||||
cbi_dropdown_init.prototype = CBIDropdown;
|
||||
|
|
Loading…
Reference in a new issue