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,9 +321,11 @@ function cbi_init() {
|
|||
widget = new (Function.prototype.bind.apply(L.ui[args[0]], args)),
|
||||
markup = widget.render();
|
||||
|
||||
Promise.resolve(markup).then(function(markup) {
|
||||
markup.addEventListener('widget-change', cbi_d_update);
|
||||
node.parentNode.replaceChild(markup, node);
|
||||
});
|
||||
});
|
||||
|
||||
cbi_d_update();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue