From 68b4df4d3d5a5e6be0f91df8c8db55bb0a0289f5 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 30 Nov 2023 14:23:49 -0800 Subject: [PATCH] Revert "Loading indicator" This reverts commit 825ce7998d33b770a194de6641c63d20e8d84194. --- .../document-detail.component.html | 7 -- .../document-detail.component.ts | 103 ++++++++---------- 2 files changed, 48 insertions(+), 62 deletions(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index b0a0ac4ba..468c42514 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -240,12 +240,6 @@ -
-
-
- Loading... -
-
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index b1fc40893..5bc0c03e5 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -154,7 +154,6 @@ export class DocumentDetailComponent previewCurrentPage: number = 1 previewNumPages: number = 1 previewZoomSetting: ZoomSetting = ZoomSetting.Width - previewLoading: boolean = true store: BehaviorSubject isDirty$: Observable @@ -446,8 +445,6 @@ export class DocumentDetailComponent .subscribe({ next: (result) => { this.metadata = result - if (this.getContentType() !== 'application/pdf') - this.previewLoading = false }, error: (error) => { this.metadata = null @@ -769,10 +766,6 @@ export class DocumentDetailComponent }) } - onPdfLoadingStarts() { - this.previewLoading = false - } - onPagesLoaded(event: PagesLoadedEvent) { this.previewNumPages = event.pagesCount } @@ -791,54 +784,6 @@ export class DocumentDetailComponent } } - onZoomSelect(event: Event) { - this.previewZoomSetting = (event.target as HTMLSelectElement) - ?.value as ZoomSetting - } - - get zoomSettings() { - return Object.values(ZoomSetting) - } - - getZoomSettingTitle(setting: ZoomSetting = null): string { - switch (setting) { - case ZoomSetting.Auto: - return $localize`Auto` - case ZoomSetting.Actual: - return $localize`Actual Size` - case ZoomSetting.Fit: - return $localize`Page Fit` - case ZoomSetting.Width: - return $localize`Page Width` - default: - return setting - } - } - - increaseZoom(): void { - let currentIndex = Object.values(ZoomSetting).indexOf( - this.previewZoomSetting - ) - if (currentIndex < 4) currentIndex = 7 - this.previewZoomSetting = - Object.values(ZoomSetting)[ - Math.min(Object.values(ZoomSetting).length - 1, currentIndex + 1) - ] - } - - decreaseZoom(): void { - let currentIndex = Object.values(ZoomSetting).indexOf( - this.previewZoomSetting - ) - if (currentIndex < 4) currentIndex = 7 - this.previewZoomSetting = - Object.values(ZoomSetting)[Math.max(4, currentIndex - 1)] - } - - print(): void { - this.printService.print() - } - get showPermissions(): boolean { return ( this.permissionsService.currentUserCan( @@ -992,4 +937,52 @@ export class DocumentDetailComponent this.updateFormForCustomFields(true) this.documentForm.updateValueAndValidity() } + + onZoomSelect(event: Event) { + this.previewZoomSetting = (event.target as HTMLSelectElement) + ?.value as ZoomSetting + } + + get zoomSettings() { + return Object.values(ZoomSetting) + } + + getZoomSettingTitle(setting: ZoomSetting = null): string { + switch (setting) { + case ZoomSetting.Auto: + return $localize`Auto` + case ZoomSetting.Actual: + return $localize`Actual Size` + case ZoomSetting.Fit: + return $localize`Page Fit` + case ZoomSetting.Width: + return $localize`Page Width` + default: + return setting + } + } + + increaseZoom(): void { + let currentIndex = Object.values(ZoomSetting).indexOf( + this.previewZoomSetting + ) + if (currentIndex < 4) currentIndex = 7 + this.previewZoomSetting = + Object.values(ZoomSetting)[ + Math.min(Object.values(ZoomSetting).length - 1, currentIndex + 1) + ] + } + + decreaseZoom(): void { + let currentIndex = Object.values(ZoomSetting).indexOf( + this.previewZoomSetting + ) + if (currentIndex < 4) currentIndex = 7 + this.previewZoomSetting = + Object.values(ZoomSetting)[Math.max(4, currentIndex - 1)] + } + + print(): void { + this.printService.print() + } }