summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-03 13:21:09 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-03 13:26:44 +0200
commitd9e9cf92d15c81284000c7c97c6f7bf2b5953c2d (patch)
treee6f92f7a8aafcd925aa054652f0d453e40d495b8 /modules/luci-base/luasrc/view
parent3c4bc228a1f7b5731cf464f3f407c9ed9ace3cd2 (diff)
luci-base: ui.js: add instantiateView() helper
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/view')
-rw-r--r--modules/luci-base/luasrc/view/view.htm9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/luci-base/luasrc/view/view.htm b/modules/luci-base/luasrc/view/view.htm
index 9220ecf299..b451e8cfbf 100644
--- a/modules/luci-base/luasrc/view/view.htm
+++ b/modules/luci-base/luasrc/view/view.htm
@@ -2,10 +2,11 @@
<div id="view">
<div class="spinning"><%:Loading view…%></div>
- <script type="text/javascript">L.require('view.<%=view%>').catch(function(err) {
- L.dom.content(document.querySelector('#view'), null);
- L.error(err);
- });</script>
+ <script type="text/javascript">
+ L.require('ui').then(function(ui) {
+ ui.instantiateView('<%=view%>');
+ });
+ </script>
</div>
<%+footer%>