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=9ae1f478960f9587e8123e61e1a2221e866da26b;p=oweals%2Fluci.git luci-base: cbi.js: avoid double-initialization of dropdowns Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 2dba54750..92c41515f 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -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); }