diff --git a/dashboard/sharedComponents/page-content/page-content.component.ts b/dashboard/sharedComponents/page-content/page-content.component.ts
index 02451c54..6ba03726 100644
--- a/dashboard/sharedComponents/page-content/page-content.component.ts
+++ b/dashboard/sharedComponents/page-content/page-content.component.ts
@@ -30,16 +30,20 @@ declare var ResizeObserver;
[attr.uk-sticky]="(headerSticky && shouldSticky)?'media: @m':null" [attr.offset]="offset"
[attr.style]="'margin-top: '+(footer_height? '-'+footer_height+'px': '0')">
diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts
index 569f1dd4..f39048df 100644
--- a/dashboard/sharedComponents/sidebar/layout.service.ts
+++ b/dashboard/sharedComponents/sidebar/layout.service.ts
@@ -208,6 +208,10 @@ export class LayoutService {
return this.replaceHeaderSubject.asObservable();
}
+ get replaceHeaderValue(): boolean {
+ return this.replaceHeaderSubject.getValue();
+ }
+
setReplaceHeader(value: boolean) {
this.replaceHeaderSubject.next(value);
}
diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts
index 6c6d9026..a24eb2d0 100644
--- a/sharedComponents/navigationBar.component.ts
+++ b/sharedComponents/navigationBar.component.ts
@@ -1,4 +1,4 @@
-import {Component, Input, OnDestroy, OnInit} from '@angular/core';
+import {ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Session, User} from '../login/utils/helper.class';
import {ConfigurationService} from '../utils/configuration/configuration.service';
@@ -29,7 +29,7 @@ export interface Header {
selector: 'navbar',
templateUrl: 'navigationBar.component.html'
})
-export class NavigationBarComponent implements OnInit, OnDestroy {
+export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
@Input() portal: string = 'connect';
@Input() onlyTop: boolean = false;
@Input() logoPath: string = 'assets/common-assets/';
@@ -77,6 +77,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
sub.unsubscribe();
}
}
+
+ ngOnChanges(changes: SimpleChanges) {
+ if(changes.header) {
+ this.setHeader(this.layoutService.replaceHeaderValue);
+ }
+ }
closeCanvas(element) {
UIkit.offcanvas(element).hide();
@@ -135,11 +141,15 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
);
}
this.subs.push(this.layoutService.replaceHeader.subscribe(replaceHeader => {
- this.replaceHeader = this.header.replaceHeader && replaceHeader;
- this.activeHeader = this.replaceHeader?this.header.replaceHeader:this.header;
+ this.setHeader(replaceHeader);
}));
}
+ setHeader(replaceHeader: boolean) {
+ this.replaceHeader = this.header.replaceHeader && replaceHeader;
+ this.activeHeader = this.replaceHeader?this.header.replaceHeader:this.header;
+ }
+
isEnabled(required, enabled) {
if (!required) {
return true;