Get vfsSelect dialog working again

This commit is contained in:
nathan
2022-03-24 13:01:41 -06:00
parent 5e2b690b2a
commit 21da0b067a
2 changed files with 23 additions and 8 deletions

View File

@@ -502,6 +502,17 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
this.__value.content = {};
}
this._template_widget = new etemplate2(this._overlayContentNode._contentNode);
// Fire an event so consumers can do their thing - etemplate will fire its own load event when its done
if(!this.dispatchEvent(new CustomEvent("before-load", {
bubbles: true,
cancelable: true,
detail: this._template_widget
})))
{
return;
}
if(this.__template.indexOf('.xet') > 0)
{
// File name provided, fetch from server
@@ -532,7 +543,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
this._template_widget.DOMContainer.setAttribute('id', this.__template.replace(/^(.*\/)?([^/]+?)(\.xet)?(\?.*)$/, '$2').replace(/\./g, '-'));
// Look for buttons after load
this._templateWidget.addEventListener("load", this._adoptTemplateButtons.bind(this));
this.addEventListener("load", this._adoptTemplateButtons);
}
render()