Legacy dialog

- Fix load event was not bubbling through to the listener
- Fix value was missing
This commit is contained in:
nathan 2022-03-23 09:48:45 -06:00
parent 2f616281e0
commit 85e247d4d6
2 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,10 @@ export class et2_dialog extends Et2Dialog
super.template = value;
}
/**
* @deprecated
* @returns {any}
*/
get div()
{
return this;
@ -82,6 +86,7 @@ for(const [key, value] of Object.entries(et2_dialog.properties))
attrs[key] = {type: type_map[attr.type?.name || attr.name] || "string"};
}
attrs["value"] = {type: "any"};
et2_attribute_registry[et2_dialog.name] = attrs
customElements.define("legacy-dialog", et2_dialog);

View File

@ -696,7 +696,12 @@ export class etemplate2
app[this.app].et2_ready(this, this.name);
}
jQuery(this._DOMContainer).trigger('load', this);
// Dispatch an event that will bubble through shadow DOM boundary (pass through custom elements)
this._DOMContainer.dispatchEvent(new CustomEvent('load', {
bubbles: true,
composed: true,
detail: this
}));
if(etemplate2.templates[this.name].attributes.onload)
{