From: Jo-Philipp Wich Date: Fri, 14 Feb 2020 07:43:28 +0000 (+0100) Subject: luci-base: cbi.js: avoid double-initialization of dropdowns X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=49999e98795d89189db4bf33cf3d56c0ac7a41a6;p=oweals%2Fluci.git luci-base: cbi.js: avoid double-initialization of dropdowns Signed-off-by: Jo-Philipp Wich (cherry picked from commit 9ae1f478960f9587e8123e61e1a2221e866da26b) --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index ff198027e..f9b601995 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -714,6 +714,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); }