mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4965] Viewer - pass navigate before and next event (#5166)
* pass event * update docs
This commit is contained in:
committed by
Denys Vuika
parent
85cd6d9506
commit
a60fb744c4
@@ -111,8 +111,8 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
|
||||
| extensionChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string>` | Emitted when the filename extension changes. |
|
||||
| goBack | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`BaseEvent`](../../../lib/core/events/base.event.ts)`<any>>` | Emitted when user clicks the 'Back' button. |
|
||||
| invalidSharedLink | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<>` | Emitted when the shared link used is not valid. |
|
||||
| navigateBefore | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<>` | Emitted when user clicks 'Navigate Before' ("<") button. |
|
||||
| navigateNext | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<>` | Emitted when user clicks 'Navigate Next' (">") button. |
|
||||
| navigateBefore | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<MouseEvent|KeybordEvent>` | Emitted when user clicks 'Navigate Before' ("<") button or keyboard left key |
|
||||
| navigateNext | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<MouseEvent|KeybordEvent>` | Emitted when user clicks 'Navigate Next' (">") button or keyboard right key. |
|
||||
| print | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`BaseEvent`](../../../lib/core/events/base.event.ts)`<any>>` | Emitted when user clicks the 'Print' button. |
|
||||
| showViewerChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when the viewer is shown or hidden. |
|
||||
|
||||
|
@@ -41,7 +41,7 @@
|
||||
mat-icon-button
|
||||
[attr.aria-label]="'ADF_VIEWER.ACTIONS.PREV_FILE' | translate"
|
||||
title="{{ 'ADF_VIEWER.ACTIONS.PREV_FILE' | translate }}"
|
||||
(click)="onNavigateBeforeClick()">
|
||||
(click)="onNavigateBeforeClick($event)">
|
||||
<mat-icon>navigate_before</mat-icon>
|
||||
</button>
|
||||
<img class="adf-viewer__mimeicon" [alt]="mimeType" [src]="mimeType | adfMimeTypeIcon" data-automation-id="adf-file-thumbnail">
|
||||
@@ -52,7 +52,7 @@
|
||||
mat-icon-button
|
||||
[attr.aria-label]="'ADF_VIEWER.ACTIONS.NEXT_FILE' | translate"
|
||||
title="{{ 'ADF_VIEWER.ACTIONS.NEXT_FILE' | translate }}"
|
||||
(click)="onNavigateNextClick()">
|
||||
(click)="onNavigateNextClick($event)">
|
||||
<mat-icon>navigate_next</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
@@ -190,11 +190,11 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
/** Emitted when user clicks 'Navigate Before' ("<") button. */
|
||||
@Output()
|
||||
navigateBefore = new EventEmitter();
|
||||
navigateBefore = new EventEmitter<MouseEvent|KeyboardEvent>();
|
||||
|
||||
/** Emitted when user clicks 'Navigate Next' (">") button. */
|
||||
@Output()
|
||||
navigateNext = new EventEmitter();
|
||||
navigateNext = new EventEmitter<MouseEvent|KeyboardEvent>();
|
||||
|
||||
/** Emitted when the shared link used is not valid. */
|
||||
@Output()
|
||||
@@ -477,12 +477,12 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.close();
|
||||
}
|
||||
|
||||
onNavigateBeforeClick() {
|
||||
this.navigateBefore.next();
|
||||
onNavigateBeforeClick(event: MouseEvent|KeyboardEvent) {
|
||||
this.navigateBefore.next(event);
|
||||
}
|
||||
|
||||
onNavigateNextClick() {
|
||||
this.navigateNext.next();
|
||||
onNavigateNextClick(event: MouseEvent|KeyboardEvent) {
|
||||
this.navigateNext.next(event);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -553,13 +553,13 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
// Left arrow
|
||||
if (key === 37 && this.canNavigateBefore) {
|
||||
event.preventDefault();
|
||||
this.onNavigateBeforeClick();
|
||||
this.onNavigateBeforeClick(event);
|
||||
}
|
||||
|
||||
// Right arrow
|
||||
if (key === 39 && this.canNavigateNext) {
|
||||
event.preventDefault();
|
||||
this.onNavigateNextClick();
|
||||
this.onNavigateNextClick(event);
|
||||
}
|
||||
|
||||
// Ctrl+F
|
||||
|
Reference in New Issue
Block a user