Add window resize event on sidenav change

pull/40/head
HardiReady 2018-07-15 18:01:27 +02:00
parent 3672bfe112
commit 478dfef4de
2 changed files with 4 additions and 1 deletions

View File

@ -98,7 +98,7 @@
<button mat-icon-button <button mat-icon-button
(click)="toggleSidebar()" (click)="toggleSidebar()"
*ngIf="router.url.includes('/stats')" *ngIf="router.url.includes('/stats')"
style="background: linear-gradient(-90deg, #dadada,transparent);"> style="background: linear-gradient(-90deg, #e8e5e5,#ffffff);margin-left: -12px;">
<mat-icon svgIcon="chevron-left" *ngIf="sidebarOpen"> <mat-icon svgIcon="chevron-left" *ngIf="sidebarOpen">
</mat-icon> </mat-icon>
<mat-icon svgIcon="chevron-right" *ngIf="!sidebarOpen"> <mat-icon svgIcon="chevron-right" *ngIf="!sidebarOpen">

View File

@ -73,6 +73,9 @@ export class AppComponent implements OnInit {
toggleSidebar() { toggleSidebar() {
this.sidebarOpen = !this.sidebarOpen; this.sidebarOpen = !this.sidebarOpen;
setTimeout(_ => {
window.dispatchEvent(new Event('resize'));
});
} }
ngOnInit() { ngOnInit() {