summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/cbi.js
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-03 19:30:29 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-10 15:28:16 +0200
commit1fcf34510a6c7994df3ca95e2e754db19870ce4b (patch)
treeb1a9921b3d4ce900d8540e30656108c52bdc1212 /modules/luci-base/htdocs/luci-static/resources/cbi.js
parent6d9a23af60f796e14dd9652d4f401db1a5ac456f (diff)
luci-base: cbi.js: handle ui elements which return a promise in render()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources/cbi.js')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js6
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();