mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 17:04:35 +04:00
luci-base: cbi.js: handle ui elements which return a promise in render()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user