From 9d3410af1c53814948cf5a4d30ab711b285fee7d Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Sat, 19 Jan 2019 11:07:37 +0100 Subject: [PATCH] Fix naviagion hiding Fixes an issue where the navigation panel was always hiding during every navigation. Also changes the backdrop of the navigation --- client/src/app/site/site.component.html | 14 +++++++------- client/src/app/site/site.component.ts | 11 ++++++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/client/src/app/site/site.component.html b/client/src/app/site/site.component.html index 261d8526c..3599889f3 100644 --- a/client/src/app/site/site.component.html +++ b/client/src/app/site/site.component.html @@ -5,7 +5,7 @@ videocam Projector @@ -88,7 +88,7 @@ mat-list-item routerLink="/search" routerLinkActive="active" - (click)="toggleSideNav()" + (click)="mobileAutoCloseNav()" > search Search @@ -98,7 +98,7 @@ mat-list-item routerLink="/legalnotice" routerLinkActive="active" - (click)="toggleSideNav()" + (click)="mobileAutoCloseNav()" > info Legal notice @@ -108,7 +108,7 @@ mat-list-item routerLink="/privacypolicy" routerLinkActive="active" - (click)="toggleSideNav()" + (click)="mobileAutoCloseNav()" > security Privacy policy @@ -118,7 +118,7 @@ mat-list-item href="https://openslides.org" target="_blank" - (click)="toggleSideNav()" + (click)="mobileAutoCloseNav()" >  Copyright by OpenSlides diff --git a/client/src/app/site/site.component.ts b/client/src/app/site/site.component.ts index 89b14aed8..566f72373 100644 --- a/client/src/app/site/site.component.ts +++ b/client/src/app/site/site.component.ts @@ -114,12 +114,21 @@ export class SiteComponent extends BaseComponent implements OnInit { } /** - * Closes the sidenav + * Toggles the side nav */ public toggleSideNav(): void { this.sideNav.toggle(); } + /** + * Automatically close the navigation in while navigating in mobile mode + */ + public mobileAutoCloseNav(): void { + if (this.vp.isMobile) { + this.sideNav.close(); + } + } + /** * Let the user change the language * @param lang the desired language (en, de, cs, ...)