diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index a3528fcace..5aa687b670 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -321,8 +321,10 @@ function cbi_init() { widget = new (Function.prototype.bind.apply(L.ui[args[0]], args)), markup = widget.render(); - markup.addEventListener('widget-change', cbi_d_update); - node.parentNode.replaceChild(markup, node); + Promise.resolve(markup).then(function(markup) { + markup.addEventListener('widget-change', cbi_d_update); + node.parentNode.replaceChild(markup, node); + }); }); cbi_d_update(); |