From f7bc5326754e119ae916a41c9e5f5696367a0e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 12 Jan 2022 13:09:06 +0200 Subject: [PATCH] Fixed arrow navigation --- .../file-preview-screen.component.html | 2 +- .../file-preview-screen.component.ts | 41 ++++++++++--------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html index 9e859f0f8..33575b2ea 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.html @@ -67,7 +67,7 @@ this.permissionsService.canPerformAnnotationActions(file) && viewMode === 'STANDARD'), @@ -331,6 +318,14 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni } } + handleArrowEvent($event: KeyboardEvent): void { + if (['ArrowUp', 'ArrowDown'].includes($event.key)) { + if (this.selectedAnnotations.length === 1) { + this._workloadComponent.navigateAnnotations($event); + } + } + } + @HostListener('window:keyup', ['$event']) handleKeyEvent($event: KeyboardEvent) { if (this._router.url.indexOf('/file/') < 0) { @@ -341,13 +336,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni return; } - if (['ArrowUp', 'ArrowDown'].includes($event.key)) { - if (this.selectedAnnotations.length === 1) { - this._workloadComponent.navigateAnnotations($event); - } - return; - } - if (['Escape'].includes($event.key)) { this.fullScreen = false; this.closeFullScreen(); @@ -447,6 +435,19 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni return false; } + private _setActiveViewerPage() { + const currentPage = this._instance?.Core.documentViewer?.getCurrentPage(); + if (!currentPage) { + this.activeViewerPage = 1; + } else { + this.activeViewerPage = this.viewModeService.isCompare + ? currentPage % 2 === 0 + ? currentPage / 2 + : (currentPage + 1) / 2 + : currentPage; + } + } + private _setExcludedPageStyles() { const file = this._filesMapService.get(this.dossierId, this.fileId); setTimeout(() => {