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>
This commit is contained in:
Jo-Philipp Wich 2022-11-09 20:26:14 +01:00
parent d88a0c8989
commit bdfdd95a27

View file

@ -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);
});
});