projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d9a23a
)
luci-base: cbi.js: handle ui elements which return a promise in render()
author
Jo-Philipp Wich
<jo@mein.io>
Tue, 3 Sep 2019 17:30:29 +0000
(19:30 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Tue, 10 Sep 2019 13:28:16 +0000
(15:28 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/cbi.js
b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index a3528fcaceab3796be12b9cdb6f8f01ba79fa942..5aa687b670831a0351a5e7fe4edbb397029cf6e0 100644
(file)
--- 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();