minor fixes for arrow nav
This commit is contained in:
parent
34af8ae3c7
commit
9f5e42f324
@ -272,7 +272,6 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
public rejectSuggestion($event: MouseEvent, annotation: AnnotationWrapper) {
|
||||
this.ngZone.run(() => {
|
||||
this._dialogRef = this._dialogService.rejectSuggestion($event, annotation, () => {
|
||||
console.log('Reject Callback');
|
||||
this.activeViewer.annotManager.deleteAnnotation(annotation.annotation, false, true);
|
||||
});
|
||||
});
|
||||
@ -368,7 +367,7 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
const page = this.selectedAnnotation.pageNumber;
|
||||
const pageIdx = this.displayedPages.indexOf(page);
|
||||
const annotationsOnPage = this.displayedAnnotations[page].annotations;
|
||||
const idx = annotationsOnPage.indexOf(this.selectedAnnotation);
|
||||
const idx = annotationsOnPage.findIndex((a) => a.id === this.selectedAnnotation.id);
|
||||
|
||||
if ($event.key === 'ArrowDown') {
|
||||
if (idx + 1 !== annotationsOnPage.length) {
|
||||
|
||||
@ -273,9 +273,11 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
|
||||
|
||||
public selectAnnotation(annotation: AnnotationWrapper) {
|
||||
this.instance.annotManager.deselectAllAnnotations();
|
||||
if (annotation?.annotation) {
|
||||
this.instance.annotManager.selectAnnotation(annotation.annotation);
|
||||
this.navigateToPage(annotation.pageNumber);
|
||||
}
|
||||
}
|
||||
|
||||
public navigateToPage(pageNumber: number) {
|
||||
const activePage = this.instance.docViewer.getCurrentPage();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user