Fix setting up widgets containing HTMX code and unify the flow for results and widgets

This commit is contained in:
2022-08-26 07:20:30 +01:00
parent 2189381fa6
commit 553d4fd33f
3 changed files with 8 additions and 25 deletions

View File

@@ -83,13 +83,11 @@
// GridStack.init();
setupTags();
document.addEventListener('load-widget', function(event) {
grid.removeWidget("drilldown-widget-results");
let container = htmx.find('#drilldown-widget');
var scripts = htmx.findAll(container, "script");
let widgetelement = container.firstElementChild.cloneNode(true);
container.firstElementChild.remove();
//let grid = document.querySelector('.grid-stack').gridstack;
container.outerHTML = "";
grid.addWidget(widgetelement);
htmx.process(widgetelement);