diff --git a/src/app/components/favorites/favorites.component.html b/src/app/components/favorites/favorites.component.html
index 323786641..7c1f3b135 100644
--- a/src/app/components/favorites/favorites.component.html
+++ b/src/app/components/favorites/favorites.component.html
@@ -9,7 +9,7 @@
mat-icon-button
*ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
- (click)="showPreview(documentList.selection[0]?.entry?.id)">
+ (click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
open_in_browser
diff --git a/src/app/components/files/files.component.html b/src/app/components/files/files.component.html
index 6461f7859..f28e822a2 100644
--- a/src/app/components/files/files.component.html
+++ b/src/app/components/files/files.component.html
@@ -11,7 +11,7 @@
mat-icon-button
*ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
- (click)="showPreview(documentList.selection[0]?.entry?.id)">
+ (click)="showPreview(documentList.selection[0]?.entry)">
open_in_browser
diff --git a/src/app/components/files/files.component.ts b/src/app/components/files/files.component.ts
index bf656c69b..8d3d7e729 100644
--- a/src/app/components/files/files.component.ts
+++ b/src/app/components/files/files.component.ts
@@ -155,6 +155,14 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
}
}
+ showPreview(node: MinimalNodeEntryEntity) {
+ if (node) {
+ if (node.isFile) {
+ this.router.navigate(['/preview', node.id]);
+ }
+ }
+ }
+
onBreadcrumbNavigate(route: PathElementEntity) {
// todo: review this approach once 5.2.3 is out
if (this.nodePath && this.nodePath.length > 2) {
diff --git a/src/app/components/recent-files/recent-files.component.html b/src/app/components/recent-files/recent-files.component.html
index daaf8a436..185a49732 100644
--- a/src/app/components/recent-files/recent-files.component.html
+++ b/src/app/components/recent-files/recent-files.component.html
@@ -9,7 +9,7 @@
mat-icon-button
*ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
- (click)="showPreview(documentList.selection[0]?.entry?.id)">
+ (click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
open_in_browser
diff --git a/src/app/components/shared-files/shared-files.component.html b/src/app/components/shared-files/shared-files.component.html
index e7eb1481d..2cfc02f49 100644
--- a/src/app/components/shared-files/shared-files.component.html
+++ b/src/app/components/shared-files/shared-files.component.html
@@ -9,7 +9,7 @@
mat-icon-button
*ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}"
- (click)="showPreview(documentList.selection[0]?.entry?.nodeId)">
+ (click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
open_in_browser