Fixed enable/disable quick nav buttons
This commit is contained in:
parent
f26c1e67ad
commit
a4b3bd498d
@ -229,7 +229,7 @@
|
||||
>
|
||||
<mat-icon svgIcon="red:nav-first"></mat-icon>
|
||||
</div>
|
||||
<div class="pages" (scroll)="onQuickNavScroll($event)">
|
||||
<div class="pages" (scroll)="computeQuickNavButtonsState()" id="pages">
|
||||
<redaction-page-indicator
|
||||
(pageSelected)="pageSelectedByClick($event)"
|
||||
*ngFor="let pageNumber of displayedPages"
|
||||
|
||||
@ -367,12 +367,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public onQuickNavScroll($event) {
|
||||
const { scrollHeight, scrollTop, clientHeight } = $event.target;
|
||||
this.quickScrollFirstEnabled = scrollTop !== 0;
|
||||
this.quickScrollLastEnabled = scrollHeight !== scrollTop + clientHeight;
|
||||
}
|
||||
|
||||
private _scrollAnnotations() {
|
||||
if (this.firstSelectedAnnotation?.pageNumber === this.activeViewerPage) {
|
||||
return;
|
||||
@ -597,6 +591,7 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
filtersChanged(filters: FilterModel[]) {
|
||||
this.displayedAnnotations = this._annotationProcessingService.filterAndGroupAnnotations(this.annotations, filters);
|
||||
this.displayedPages = Object.keys(this.displayedAnnotations).map((key) => Number(key));
|
||||
this.computeQuickNavButtonsState();
|
||||
this._changeDetectorRef.markForCheck();
|
||||
}
|
||||
|
||||
@ -606,6 +601,13 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public computeQuickNavButtonsState() {
|
||||
const element: HTMLElement = this._quickNavigationElement.nativeElement.querySelector(`#pages`);
|
||||
const { scrollTop, scrollHeight, clientHeight } = element;
|
||||
this.quickScrollFirstEnabled = scrollTop !== 0;
|
||||
this.quickScrollLastEnabled = scrollHeight !== scrollTop + clientHeight;
|
||||
}
|
||||
|
||||
private _cleanupAndRedrawManualAnnotations() {
|
||||
this._fileDownloadService.loadActiveFileManualAnnotations().subscribe((manualRedactions) => {
|
||||
this.fileData.manualRedactions = manualRedactions;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user