From 7e59b24f2c1eb8054a67e2048b54e09c1049d89e Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Wed, 30 May 2018 12:30:01 +0200 Subject: [PATCH] fix demo shell gallery view switch (#3413) --- .../src/app/components/files/files.component.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/demo-shell/src/app/components/files/files.component.ts b/demo-shell/src/app/components/files/files.component.ts index 0eb334fde0..5ef6b09cf5 100644 --- a/demo-shell/src/app/components/files/files.component.ts +++ b/demo-shell/src/app/components/files/files.component.ts @@ -309,7 +309,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { } onFolderChange($event) { - this.router.navigate(['/files', $event.value.id]); + this.router.navigate(['/files', $event.value.id, 'display', this.displayMode]); } handlePermissionError(event: any) { @@ -492,18 +492,13 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { } toogleGalleryView(): void { + this.displayMode = this.displayMode === DisplayMode.List ? DisplayMode.Gallery : DisplayMode.List; const url = this .router .createUrlTree(['/files', this.currentFolderId, 'display', this.displayMode]) .toString(); - if (this.displayMode === DisplayMode.List) { - this.displayMode = DisplayMode.Gallery; - this.location.go(url); - } else { - this.displayMode = DisplayMode.List; - this.location.go(url); - } + this.location.go(url); } onInfiniteScrolling(): void {