diff --git a/docs/core/components/viewer.component.md b/docs/core/components/viewer.component.md index 5c43d2e5b3..016d899488 100644 --- a/docs/core/components/viewer.component.md +++ b/docs/core/components/viewer.component.md @@ -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)`` | Emitted when the filename extension changes. | | goBack | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`BaseEvent`](../../../lib/core/events/base.event.ts)`>` | 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)`` | Emitted when user clicks 'Navigate Before' ("<") button or keyboard left key | +| navigateNext | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | 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)`>` | Emitted when user clicks the 'Print' button. | | showViewerChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the viewer is shown or hidden. | diff --git a/lib/core/viewer/components/viewer.component.html b/lib/core/viewer/components/viewer.component.html index c11d5a2776..e8ac50229b 100644 --- a/lib/core/viewer/components/viewer.component.html +++ b/lib/core/viewer/components/viewer.component.html @@ -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)"> navigate_before @@ -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)"> navigate_next diff --git a/lib/core/viewer/components/viewer.component.ts b/lib/core/viewer/components/viewer.component.ts index ae87bd036a..4a69a2e4ea 100644 --- a/lib/core/viewer/components/viewer.component.ts +++ b/lib/core/viewer/components/viewer.component.ts @@ -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(); /** Emitted when user clicks 'Navigate Next' (">") button. */ @Output() - navigateNext = new EventEmitter(); + navigateNext = new EventEmitter(); /** 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