Fix legacy et2_createWidget() did not properly load webComponents when they had "et2-<tag>"

This commit is contained in:
nathan 2024-12-11 14:57:53 -07:00
parent 5ab1aaf80c
commit 26d2ea4616

View File

@ -97,10 +97,17 @@ export function et2_createWidget(_name: string, _attrs: object, _parent?: any):
} }
// check and return web-components in case widget is no longer available as legacy widget // check and return web-components in case widget is no longer available as legacy widget
if (typeof et2_registry[_name] === "undefined" && window.customElements.get('et2-'+_name)) if(typeof et2_registry[_name] === "undefined")
{
if(window.customElements.get('et2-' + _name))
{ {
return loadWebComponent('et2-' + _name, _attrs, _parent); return loadWebComponent('et2-' + _name, _attrs, _parent);
} }
else if(window.customElements.get(_name))
{
return loadWebComponent(_name, _attrs, _parent);
}
}
// Parse the "readonly" and "type" flag for this element here, as they // Parse the "readonly" and "type" flag for this element here, as they
// determine which constructor is used // determine which constructor is used