simplified initial page

This commit is contained in:
Timo Bejan 2021-12-21 15:24:39 +02:00
parent 5da318496d
commit 9ccba63a3a
4 changed files with 12 additions and 18 deletions

View File

@ -94,7 +94,6 @@
<mat-icon svgIcon="red:nav-first"></mat-icon>
</div>
{{activeViewerPage}}
<div class="pages" id="pages">
<redaction-page-indicator
(pageSelected)="pageSelectedByClick($event)"

View File

@ -82,7 +82,6 @@ export class PdfViewerComponent implements OnInit, OnChanges {
annotationManager: Core.AnnotationManager;
utils: PdfViewerUtils;
private _selectedText = '';
private _firstPageChange = true;
constructor(
@Inject(BASE_HREF) private readonly _baseHref: string,
@ -248,15 +247,7 @@ export class PdfViewerComponent implements OnInit, OnChanges {
if (this.shouldDeselectAnnotationsOnPageChange) {
this.utils.deselectAllAnnotations();
}
if (this._firstPageChange && pageNumber === 1) {
this._firstPageChange = false;
const routePageNumber = this._activatedRoute.snapshot.queryParams.page;
if (pageNumber) {
this.utils.navigateToPage(parseInt(routePageNumber, 10));
}
} else {
this._ngZone.run(() => this.pageChanged.emit(pageNumber));
}
this._ngZone.run(() => this.pageChanged.emit(pageNumber));
this._handleCustomActions();
});
@ -648,8 +639,9 @@ export class PdfViewerComponent implements OnInit, OnChanges {
private _setReadyAndInitialState(): void {
this._ngZone.run(() => {
this.utils.ready = true;
this._firstPageChange = true;
this.viewerReady.emit(this.instance);
const routePageNumber = this._activatedRoute.snapshot.queryParams.page;
this.pageChanged.emit(routePageNumber || 1);
this._setInitialDisplayMode();
this._updateTooltipsVisibility();
});

View File

@ -74,7 +74,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
selectedAnnotations: AnnotationWrapper[] = [];
hideSkipped = false;
displayPdfViewer = false;
activeViewerPage : number = null;
activeViewerPage: number = null;
@ViewChild(PdfViewerComponent) readonly viewerComponent: PdfViewerComponent;
readonly dossierId: string;
readonly canPerformAnnotationActions$: Observable<boolean>;
@ -151,9 +151,13 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
private _setActiveViewerPage() {
const currentPage = this._instance?.Core.documentViewer?.getCurrentPage();
if (!currentPage) {
this.activeViewerPage = 0;
this.activeViewerPage = 1;
} else {
this.activeViewerPage = this.viewModeService.isCompare ? currentPage % 2 === 0 ? currentPage / 2 : (currentPage + 1) / 2 : currentPage;
this.activeViewerPage = this.viewModeService.isCompare
? currentPage % 2 === 0
? currentPage / 2
: (currentPage + 1) / 2
: currentPage;
}
}
@ -393,7 +397,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
};
this._router.navigate([], extras).then();
this._setActiveViewerPage();
this._changeDetectorRef.markForCheck();
}

View File

@ -1,7 +1,7 @@
{
"ADMIN_CONTACT_NAME": null,
"ADMIN_CONTACT_URL": null,
"API_URL": "https://aks-staging.iqser.cloud/redaction-gateway-v1",
"API_URL": "https://dev-03.iqser.cloud/redaction-gateway-v1",
"APP_NAME": "RedactManager",
"AUTO_READ_TIME": 1.5,
"BACKEND_APP_VERSION": "4.4.40",
@ -17,7 +17,7 @@
"MAX_RETRIES_ON_SERVER_ERROR": 3,
"OAUTH_CLIENT_ID": "redaction",
"OAUTH_IDP_HINT": null,
"OAUTH_URL": "https://aks-staging.iqser.cloud/auth/realms/redaction",
"OAUTH_URL": "https://dev-03.iqser.cloud/auth/realms/redaction",
"RECENT_PERIOD_IN_HOURS": 24,
"SELECTION_MODE": "structural"
}