Revert "Add Paperless zoom"
This reverts commit 74e1d2071174223ef61465a0cf8eb349dfa96704.
This commit is contained in:
parent
5418981539
commit
3a851797e2
@ -1,20 +1,9 @@
|
|||||||
<pngx-page-header [(title)]="title">
|
<pngx-page-header [(title)]="title">
|
||||||
<ng-container *ngIf="getContentType() === 'application/pdf' && !useNativePdfViewer">
|
<div class="input-group input-group-sm me-5 d-none d-md-flex" *ngIf="getContentType() === 'application/pdf' && !useNativePdfViewer">
|
||||||
<div class="input-group input-group-sm me-2 d-none d-md-flex">
|
<div class="input-group-text" i18n>Page</div>
|
||||||
<div class="input-group-text" i18n>Page</div>
|
<input class="form-control flex-grow-0 w-auto" type="number" min="1" [max]="previewNumPages" [(ngModel)]="previewCurrentPage" />
|
||||||
<input class="form-control flex-grow-0 w-auto" type="number" min="1" [max]="previewNumPages" [(ngModel)]="previewCurrentPage" />
|
<div class="input-group-text" i18n>of {{previewNumPages}}</div>
|
||||||
<div class="input-group-text" i18n>of {{previewNumPages}}</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="input-group input-group-sm me-5 d-none d-md-flex">
|
|
||||||
<button class="btn btn-outline-secondary" (click)="decreaseZoom()" i18n>-</button>
|
|
||||||
<select class="form-select" (change)="onZoomSelect($event)">
|
|
||||||
<option *ngFor="let setting of zoomSettings" [value]="setting" [selected]="previewZoomSetting == setting">
|
|
||||||
{{ getZoomSettingTitle(setting) }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<button class="btn btn-outline-secondary" (click)="increaseZoom()" i18n>+</button>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-sm btn-outline-danger me-4" (click)="delete()" [disabled]="!userIsOwner" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.Document }">
|
<button type="button" class="btn btn-sm btn-outline-danger me-4" (click)="delete()" [disabled]="!userIsOwner" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.Document }">
|
||||||
<svg class="buttonicon" fill="currentColor">
|
<svg class="buttonicon" fill="currentColor">
|
||||||
@ -238,8 +227,15 @@
|
|||||||
<ngx-extended-pdf-viewer
|
<ngx-extended-pdf-viewer
|
||||||
[src]="previewUrl"
|
[src]="previewUrl"
|
||||||
[useBrowserLocale]="true"
|
[useBrowserLocale]="true"
|
||||||
[showToolbar]="false"
|
[showPagingButtons]="false"
|
||||||
[zoom]="previewZoomSetting"
|
[showRotateButton]="false"
|
||||||
|
[showHandToolButton]="false"
|
||||||
|
[showOpenFileButton]="false"
|
||||||
|
[showDownloadButton]="false"
|
||||||
|
[showDrawEditor]="false"
|
||||||
|
[showTextEditor]="false"
|
||||||
|
[showSecondaryToolbarButton]="false"
|
||||||
|
[showStampEditor]="false"
|
||||||
(pagesLoaded)="onPagesLoaded($event)"
|
(pagesLoaded)="onPagesLoaded($event)"
|
||||||
(pdfLoadingFailed)="onPdfLoadingFailed($event)"
|
(pdfLoadingFailed)="onPdfLoadingFailed($event)"
|
||||||
[(page)]="previewCurrentPage">
|
[(page)]="previewCurrentPage">
|
||||||
|
@ -87,20 +87,6 @@ enum DocumentDetailNavIDs {
|
|||||||
Permissions = 6,
|
Permissions = 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ZoomSetting {
|
|
||||||
Auto = 'auto',
|
|
||||||
Actual = 'page-actual',
|
|
||||||
Fit = 'page-fit',
|
|
||||||
Width = 'page-width',
|
|
||||||
Quarter = '25%',
|
|
||||||
Half = '50%',
|
|
||||||
ThreeQuarters = '75%',
|
|
||||||
OneHundred = '100%',
|
|
||||||
OneHundredFifty = '150%',
|
|
||||||
TwoHundred = '200%',
|
|
||||||
ThreeHundred = '300%',
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'pngx-document-detail',
|
selector: 'pngx-document-detail',
|
||||||
templateUrl: './document-detail.component.html',
|
templateUrl: './document-detail.component.html',
|
||||||
@ -152,7 +138,6 @@ export class DocumentDetailComponent
|
|||||||
|
|
||||||
previewCurrentPage: number = 1
|
previewCurrentPage: number = 1
|
||||||
previewNumPages: number = 1
|
previewNumPages: number = 1
|
||||||
previewZoomSetting: ZoomSetting = ZoomSetting.Width
|
|
||||||
|
|
||||||
store: BehaviorSubject<any>
|
store: BehaviorSubject<any>
|
||||||
isDirty$: Observable<boolean>
|
isDirty$: Observable<boolean>
|
||||||
@ -935,48 +920,4 @@ export class DocumentDetailComponent
|
|||||||
this.updateFormForCustomFields(true)
|
this.updateFormForCustomFields(true)
|
||||||
this.documentForm.updateValueAndValidity()
|
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)]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user