Revert "Loading indicator"
This reverts commit 825ce7998d33b770a194de6641c63d20e8d84194.
This commit is contained in:
parent
042073a061
commit
68b4df4d3d
@ -240,12 +240,6 @@
|
||||
</div>
|
||||
|
||||
<ng-template #previewContent>
|
||||
<div *ngIf="previewLoading" class="w-100 h-100 d-flex align-items-center justify-content-center">
|
||||
<div>
|
||||
<div class="spinner-border spinner-border-sm me-2" role="status"></div>
|
||||
<ng-container i18n>Loading...</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngIf="getContentType() === 'application/pdf'">
|
||||
<div class="preview-sticky pdf-viewer-container" *ngIf="!useNativePdfViewer ; else nativePdfViewer">
|
||||
<ngx-extended-pdf-viewer
|
||||
@ -254,7 +248,6 @@
|
||||
[showToolbar]="false"
|
||||
[zoom]="previewZoomSetting"
|
||||
(pagesLoaded)="onPagesLoaded($event)"
|
||||
(pdfLoadingStarts)="onPdfLoadingStarts()"
|
||||
(pdfLoadingFailed)="onPdfLoadingFailed($event)"
|
||||
[(page)]="previewCurrentPage">
|
||||
</ngx-extended-pdf-viewer>
|
||||
|
@ -154,7 +154,6 @@ export class DocumentDetailComponent
|
||||
previewCurrentPage: number = 1
|
||||
previewNumPages: number = 1
|
||||
previewZoomSetting: ZoomSetting = ZoomSetting.Width
|
||||
previewLoading: boolean = true
|
||||
|
||||
store: BehaviorSubject<any>
|
||||
isDirty$: Observable<boolean>
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user