From 49999e98795d89189db4bf33cf3d56c0ac7a41a6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 14 Feb 2020 08:43:28 +0100 Subject: [PATCH] luci-base: cbi.js: avoid double-initialization of dropdowns Signed-off-by: Jo-Philipp Wich (cherry picked from commit 9ae1f478960f9587e8123e61e1a2221e866da26b) --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.25.1