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:
parent
6d9a23af60
commit
1fcf34510a
1 changed files with 4 additions and 2 deletions
|
@ -321,8 +321,10 @@ function cbi_init() {
|
||||||
widget = new (Function.prototype.bind.apply(L.ui[args[0]], args)),
|
widget = new (Function.prototype.bind.apply(L.ui[args[0]], args)),
|
||||||
markup = widget.render();
|
markup = widget.render();
|
||||||
|
|
||||||
markup.addEventListener('widget-change', cbi_d_update);
|
Promise.resolve(markup).then(function(markup) {
|
||||||
node.parentNode.replaceChild(markup, node);
|
markup.addEventListener('widget-change', cbi_d_update);
|
||||||
|
node.parentNode.replaceChild(markup, node);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
cbi_d_update();
|
cbi_d_update();
|
||||||
|
|
Loading…
Reference in a new issue