luci-base: cbi.js: avoid double-initialization of dropdowns

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-02-14 08:43:28 +01:00
parent 5258080ce3
commit 9ae1f47896

View file

@ -731,6 +731,9 @@ if (typeof(window.CustomEvent) !== 'function') {
}
function cbi_dropdown_init(sb) {
if (sb && L.dom.findClassInstance(sb) instanceof L.ui.Dropdown)
return;
var dl = new L.ui.Dropdown(sb, null, { name: sb.getAttribute('name') });
return dl.bind(sb);
}