diff --git a/src/components/app-link/AppLinkElement.ts b/src/components/app-link/AppLinkElement.ts index 47e305d..ef529df 100644 --- a/src/components/app-link/AppLinkElement.ts +++ b/src/components/app-link/AppLinkElement.ts @@ -10,6 +10,7 @@ class AppLinkElement extends BaseComponentElement { @attr to: string; @attr goBack: string; @attr title: string; + @attr customAction: string; @target main: Element; constructor() { super(); @@ -61,7 +62,7 @@ class AppLinkElement extends BaseComponentElement { : html`${this.title} { + if (window.innerWidth < deviceWidths.mobile) { + (this.appMain?.mainRoot?.rootElement as MenuLayoutElement)?.retractMenu?.(); + } + }; + render = (): TemplateResult => { return html`
- ${this.title} + ${this.title} ${this.customaction ? html`
+
` : html``} diff --git a/src/core/constants/deviceWidths.ts b/src/core/constants/deviceWidths.ts new file mode 100644 index 0000000..90e04c1 --- /dev/null +++ b/src/core/constants/deviceWidths.ts @@ -0,0 +1,3 @@ +export default { + mobile: 600, +}; diff --git a/src/core/constants/index.ts b/src/core/constants/index.ts index 51297e7..7d9008a 100644 --- a/src/core/constants/index.ts +++ b/src/core/constants/index.ts @@ -1 +1,2 @@ export * from './validatorErrors'; +export { default as deviceWidths } from './deviceWidths';