From bdfdd95a273f6fc73017795805dcfe6ee1ae8a8e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 9 Nov 2022 20:26:14 +0100 Subject: [PATCH] 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 --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); + }); }); -- 2.30.2