From fc0409c8e85056625db1537dc042741855c7500b Mon Sep 17 00:00:00 2001 From: lacksfish Date: Wed, 6 Dec 2023 11:46:58 +0100 Subject: [PATCH] Fix toggle issues in sidenav (pinning and on page refresh) --- src/app/app.component.html | 4 ++-- src/app/app.component.ts | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 3f4b696f..2b857179 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@
- > +
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4d9ab7cc..812663fa 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -159,7 +159,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy { } ngAfterViewInit() { - if (this.smallScreen || !this.flgLoggedIn) { this.sideNavigation.close(); } + if (this.smallScreen || !this.flgLoggedIn) { + this.flgSideNavOpened = !this.flgSideNavOpened; + this.sideNavigation.close(); + } this.commonService.setContainerSize(this.sideNavContent.elementRef.nativeElement.clientWidth, this.sideNavContent.elementRef.nativeElement.clientHeight); } @@ -170,6 +173,14 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy { onNavigationClicked(event: any) { if (this.smallScreen) { + this.flgSideNavOpened = !this.flgSideNavOpened; + this.sideNavigation.close(); + } + } + + backdropClicked() { + if (!this.flgSidenavPinned || this.smallScreen) { + this.flgSideNavOpened = !this.flgSideNavOpened; this.sideNavigation.close(); } }