Fix naviagion hiding

Fixes an issue where the navigation panel was always hiding during
every navigation.

Also changes the backdrop of the navigation
This commit is contained in:
Sean Engelhardt 2019-01-19 11:07:37 +01:00
parent 1cdeb3bcb8
commit 9d3410af1c
2 changed files with 17 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<mat-sidenav-container #siteContainer class="main-container" (backdropClick)="toggleSideNav()"> <mat-sidenav-container #siteContainer class="main-container" (backdropClick)="toggleSideNav()">
<mat-sidenav <mat-sidenav
#sideNav #sideNav
[mode]="vp.isMobile ? 'push' : 'side'" [mode]="vp.isMobile ? 'over' : 'side'"
[opened]="!vp.isMobile" [opened]="!vp.isMobile"
disableClose="!vp.isMobile" disableClose="!vp.isMobile"
class="side-panel" class="side-panel"
@ -62,7 +62,7 @@
[@navItemAnim] [@navItemAnim]
*osPerms="entry.permission" *osPerms="entry.permission"
mat-list-item mat-list-item
(click)="toggleSideNav()" (click)="mobileAutoCloseNav()"
[routerLink]="entry.route" [routerLink]="entry.route"
routerLinkActive="active" routerLinkActive="active"
[routerLinkActiveOptions]="{ exact: entry.route === '/' }" [routerLinkActiveOptions]="{ exact: entry.route === '/' }"
@ -77,7 +77,7 @@
mat-list-item mat-list-item
routerLink="/projector" routerLink="/projector"
routerLinkActive="active" routerLinkActive="active"
(click)="toggleSideNav()" (click)="mobileAutoCloseNav()"
> >
<mat-icon>videocam</mat-icon> <mat-icon>videocam</mat-icon>
<span translate>Projector</span> <span translate>Projector</span>
@ -88,7 +88,7 @@
mat-list-item mat-list-item
routerLink="/search" routerLink="/search"
routerLinkActive="active" routerLinkActive="active"
(click)="toggleSideNav()" (click)="mobileAutoCloseNav()"
> >
<mat-icon>search</mat-icon> <mat-icon>search</mat-icon>
<span translate>Search</span> <span translate>Search</span>
@ -98,7 +98,7 @@
mat-list-item mat-list-item
routerLink="/legalnotice" routerLink="/legalnotice"
routerLinkActive="active" routerLinkActive="active"
(click)="toggleSideNav()" (click)="mobileAutoCloseNav()"
> >
<mat-icon>info</mat-icon> <mat-icon>info</mat-icon>
<span translate>Legal notice</span> <span translate>Legal notice</span>
@ -108,7 +108,7 @@
mat-list-item mat-list-item
routerLink="/privacypolicy" routerLink="/privacypolicy"
routerLinkActive="active" routerLinkActive="active"
(click)="toggleSideNav()" (click)="mobileAutoCloseNav()"
> >
<mat-icon>security</mat-icon> <mat-icon>security</mat-icon>
<span translate>Privacy policy</span> <span translate>Privacy policy</span>
@ -118,7 +118,7 @@
mat-list-item mat-list-item
href="https://openslides.org" href="https://openslides.org"
target="_blank" target="_blank"
(click)="toggleSideNav()" (click)="mobileAutoCloseNav()"
> >
<span><small><os-copyright-sign></os-copyright-sign>&nbsp;Copyright by OpenSlides</small></span> <span><small><os-copyright-sign></os-copyright-sign>&nbsp;Copyright by OpenSlides</small></span>
</a> </a>

View File

@ -114,12 +114,21 @@ export class SiteComponent extends BaseComponent implements OnInit {
} }
/** /**
* Closes the sidenav * Toggles the side nav
*/ */
public toggleSideNav(): void { public toggleSideNav(): void {
this.sideNav.toggle(); 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 * Let the user change the language
* @param lang the desired language (en, de, cs, ...) * @param lang the desired language (en, de, cs, ...)