Dialog work

- Add destroy() to remove dialog

Fixes admin ACL dialog
This commit is contained in:
nathan 2022-12-01 10:24:17 -07:00
parent d6d77546a5
commit 83ab58329e
2 changed files with 13 additions and 4 deletions

View File

@ -386,6 +386,15 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog))
this.removeEventListener("sl-after-show", this.handleOpen);
}
destroy()
{
if(this.template)
{
this.template.clear(true);
}
this.remove();
}
addOpenListeners()
{
//super.addOpenListeners();

View File

@ -2088,12 +2088,12 @@ export class CalendarApp extends EgwApp
return false;
}
// Insert the content into the correct place
add_dialog._overlayContentNode._contentNode.remove();
add_dialog._overlayContentNode.insertAdjacentHTML("beforeend", content.html);
let template = add_dialog._overlayContentNode.querySelector("[id='calendar-add']");
add_dialog._contentNode.remove();
add_dialog.insertAdjacentHTML("beforeend", content.html);
let template = add_dialog.querySelector("[id='calendar-add']");
if(template)
{
template.slot = "content";
template.slot = "";
template.addEventListener("load", add_dialog._adoptTemplateButtons);
}
}