mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
Use webcomponent for tabs
+ handle tabs set by variable better
This commit is contained in:
parent
87198dc7a8
commit
d438b4e355
@ -13,7 +13,7 @@
|
|||||||
use EGroupware\Api;
|
use EGroupware\Api;
|
||||||
|
|
||||||
// add et2- prefix to following widgets/tags, if NO <overlay legacy="true"
|
// add et2- prefix to following widgets/tags, if NO <overlay legacy="true"
|
||||||
const ADD_ET2_PREFIX_REGEXP = '#<((/?)([vh]?box))(/?|\s[^>]*)>#m';
|
const ADD_ET2_PREFIX_REGEXP = '#<((/?)([vh]?box|tabbox))(/?|\s[^>]*)>#m';
|
||||||
const ADD_ET2_PREFIX_LAST_GROUP = 4;
|
const ADD_ET2_PREFIX_LAST_GROUP = 4;
|
||||||
|
|
||||||
// unconditional of legacy add et2- prefix to this widgets
|
// unconditional of legacy add et2- prefix to this widgets
|
||||||
|
@ -12,6 +12,7 @@ import {Et2Widget, loadWebComponent} from "../../Et2Widget/Et2Widget";
|
|||||||
import {et2_directChildrenByTagName, et2_filteredNodeIterator, et2_readAttrWithDefault} from "../../et2_core_xml";
|
import {et2_directChildrenByTagName, et2_filteredNodeIterator, et2_readAttrWithDefault} from "../../et2_core_xml";
|
||||||
import {css, PropertyValues} from "@lion/core";
|
import {css, PropertyValues} from "@lion/core";
|
||||||
import shoelace from "../../Styles/shoelace";
|
import shoelace from "../../Styles/shoelace";
|
||||||
|
import {et2_createWidget} from "../../et2_core_widget";
|
||||||
|
|
||||||
|
|
||||||
export class Et2Tabs extends Et2Widget(SlTabGroup)
|
export class Et2Tabs extends Et2Widget(SlTabGroup)
|
||||||
@ -306,11 +307,19 @@ export class Et2Tabs extends Et2Widget(SlTabGroup)
|
|||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
// Tab content
|
// Tab content
|
||||||
let tabContent = tab.contentDiv.createElementFromNode(tab.XMLNode);
|
if(tab.XMLNode)
|
||||||
tab.contentDiv.appendChild(
|
{
|
||||||
typeof window.customElements.get(tab.XMLNode.nodeName) == "undefined" ?
|
// Just read the XMLNode
|
||||||
tabContent.getDOMNode() : tabContent
|
let tabContent = tab.contentDiv.createElementFromNode(tab.XMLNode);
|
||||||
);
|
tab.contentDiv.appendChild(
|
||||||
|
typeof window.customElements.get(tab.XMLNode.nodeName) == "undefined" ?
|
||||||
|
tabContent.getDOMNode() : tabContent
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
et2_createWidget('template', tab.widget_options, tab.contentDiv);
|
||||||
|
}
|
||||||
|
|
||||||
return tab.contentDiv;
|
return tab.contentDiv;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user