diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-11-09 20:26:14 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-11-09 20:30:20 +0100 |
commit | bdfdd95a273f6fc73017795805dcfe6ee1ae8a8e (patch) | |
tree | 51f900c1203b7c6c7d486bf1340b895dba4bf85f /modules/luci-base/htdocs | |
parent | d88a0c89896d87b4b64c69898c37088c0594f37a (diff) |
luci-base: cbi.js: await L.ui load before updating tables
On legacy views, the `L.ui` JavaScript class is not automatically loaded,
so request it before updating tables.
Fixes: e0e6989a4a ("luci-base: introduce new LuCI.ui.Table class")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/cbi.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 65ea6bce3c..3fc6edf29f 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -796,5 +796,7 @@ document.addEventListener('DOMContentLoaded', function() { L.hideTooltip(ev); }); - document.querySelectorAll('.table').forEach(cbi_update_table); + L.require('ui').then(function(ui) { + document.querySelectorAll('.table').forEach(cbi_update_table); + }); }); |