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(); } }