From cd4a5faf3827c1bfa2e32fc0c6aa32b29dbd985c Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 6 Mar 2024 13:33:26 +0200 Subject: [PATCH] [master]: Fix getmaxwidth for server side. --- src/app/app.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 891f093..593726d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -124,7 +124,6 @@ export class AppComponent extends ResearcherBaseComponent implements OnInit, Aft protected _searchResearchResultsService: SearchResearchResultsService ) { super(); - this.getWindowWidth(); // this.configurationService.initStaticPortal(this.irish.portal); // this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity); this.setProperties(this.properties.adminToolsCommunity, this.properties.adminToolsPortalType); @@ -135,6 +134,7 @@ export class AppComponent extends ResearcherBaseComponent implements OnInit, Aft @HostListener('window:resize', ['$event']) onResize(event) { this.getWindowWidth(); + this.buildMenuItems(); } ngOnDestroy() { @@ -147,6 +147,9 @@ export class AppComponent extends ResearcherBaseComponent implements OnInit, Aft ngOnInit() { this.isClient = typeof document !== 'undefined'; + if(this.isClient) { + this.getWindowWidth(); + } if (this.properties.environment == 'beta') { this.header.environmentBadge = { asset: 'assets/badge/sandbox.svg' @@ -307,6 +310,5 @@ export class AppComponent extends ResearcherBaseComponent implements OnInit, Aft } else { this.compactMenuItems = false; } - this.buildMenuItems(); } }