From 0fe358c781378f6942dc9216a8f867467c58a5d2 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 24 Nov 2023 10:51:22 +0200 Subject: [PATCH] [angular-16-irish-monitor]: Add rootClass subject in layout service. (cherry picked from commit 246cafa43fead561c5d08ea3329c503e3fdb8b11) --- .../sharedComponents/sidebar/layout.service.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts index 02754405..29b83bd0 100644 --- a/dashboard/sharedComponents/sidebar/layout.service.ts +++ b/dashboard/sharedComponents/sidebar/layout.service.ts @@ -83,7 +83,11 @@ export class LayoutService { * Add hasStickyHeaderOnMobile: true in order to activate uk-sticky in header of mobile/tablet devices. * */ private hasStickyHeaderOnMobileSubject: BehaviorSubject = new BehaviorSubject(false); - + /** + * Add a class in root element of the html. (For different theme apply) + * Handle it manually in the component, it doesn't use data + * */ + private rootClassSubject: BehaviorSubject = new BehaviorSubject(null); private subscriptions: any[] = []; ngOnDestroy() { @@ -329,4 +333,12 @@ export class LayoutService { setHasStickyHeaderOnMobile(value: boolean) { this.hasStickyHeaderOnMobileSubject.next(value); } + + get rootClass(): Observable { + return this.rootClassSubject.asObservable(); + } + + setRootClass(value: string = null): void { + this.rootClassSubject.next(value); + } }