From 9ae1f478960f9587e8123e61e1a2221e866da26b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 14 Feb 2020 08:43:28 +0100 Subject: luci-base: cbi.js: avoid double-initialization of dropdowns Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules') 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); } -- cgit v1.2.3