fix "view" button (toolbar)

This commit is contained in:
Denys Vuika
2017-12-14 17:03:46 +00:00
parent a25e622047
commit 0a824dd75d
5 changed files with 12 additions and 4 deletions

View File

@@ -9,7 +9,7 @@
mat-icon-button mat-icon-button
*ngIf="canPreviewFile(documentList.selection)" *ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}" title="{{ 'APP.ACTIONS.VIEW' | translate }}"
(click)="showPreview(documentList.selection[0]?.entry?.id)"> (click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
<mat-icon>open_in_browser</mat-icon> <mat-icon>open_in_browser</mat-icon>
</button> </button>

View File

@@ -11,7 +11,7 @@
mat-icon-button mat-icon-button
*ngIf="canPreviewFile(documentList.selection)" *ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}" title="{{ 'APP.ACTIONS.VIEW' | translate }}"
(click)="showPreview(documentList.selection[0]?.entry?.id)"> (click)="showPreview(documentList.selection[0]?.entry)">
<mat-icon>open_in_browser</mat-icon> <mat-icon>open_in_browser</mat-icon>
</button> </button>

View File

@@ -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) { onBreadcrumbNavigate(route: PathElementEntity) {
// todo: review this approach once 5.2.3 is out // todo: review this approach once 5.2.3 is out
if (this.nodePath && this.nodePath.length > 2) { if (this.nodePath && this.nodePath.length > 2) {

View File

@@ -9,7 +9,7 @@
mat-icon-button mat-icon-button
*ngIf="canPreviewFile(documentList.selection)" *ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}" title="{{ 'APP.ACTIONS.VIEW' | translate }}"
(click)="showPreview(documentList.selection[0]?.entry?.id)"> (click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
<mat-icon>open_in_browser</mat-icon> <mat-icon>open_in_browser</mat-icon>
</button> </button>

View File

@@ -9,7 +9,7 @@
mat-icon-button mat-icon-button
*ngIf="canPreviewFile(documentList.selection)" *ngIf="canPreviewFile(documentList.selection)"
title="{{ 'APP.ACTIONS.VIEW' | translate }}" title="{{ 'APP.ACTIONS.VIEW' | translate }}"
(click)="showPreview(documentList.selection[0]?.entry?.nodeId)"> (click)="onNodeDoubleClick(documentList.selection[0]?.entry)">
<mat-icon>open_in_browser</mat-icon> <mat-icon>open_in_browser</mat-icon>
</button> </button>