mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-23 10:39:25 -05:00
Fix: fix zoom increase/decrease buttons in FF
This commit is contained in:
parent
648cfd9d05
commit
a5d6c62b86
@ -9,9 +9,9 @@
|
|||||||
}
|
}
|
||||||
<div class="input-group input-group-sm me-md-5 d-none d-md-flex">
|
<div class="input-group input-group-sm me-md-5 d-none d-md-flex">
|
||||||
<button class="btn btn-outline-secondary" (click)="decreaseZoom()" i18n>-</button>
|
<button class="btn btn-outline-secondary" (click)="decreaseZoom()" i18n>-</button>
|
||||||
<select class="form-select" (change)="setZoom($event.target.value)">
|
<select class="form-select" (change)="setZoom($event.target.value)" [ngModel]="currentZoom">
|
||||||
@for (setting of zoomSettings; track setting) {
|
@for (setting of zoomSettings; track setting) {
|
||||||
<option [value]="setting" [attr.selected]="isZoomSelected(setting) ? 'selected' : null">
|
<option [value]="setting">
|
||||||
{{ getZoomSettingTitle(setting) }}
|
{{ getZoomSettingTitle(setting) }}
|
||||||
</option>
|
</option>
|
||||||
}
|
}
|
||||||
|
@ -791,14 +791,9 @@ describe('DocumentDetailComponent', () => {
|
|||||||
it('should select correct zoom setting in dropdown', () => {
|
it('should select correct zoom setting in dropdown', () => {
|
||||||
initNormally()
|
initNormally()
|
||||||
component.setZoom(ZoomSetting.PageFit)
|
component.setZoom(ZoomSetting.PageFit)
|
||||||
expect(component.isZoomSelected(ZoomSetting.PageFit)).toBeTruthy()
|
expect(component.currentZoom).toEqual(ZoomSetting.PageFit)
|
||||||
expect(component.isZoomSelected(ZoomSetting.One)).toBeFalsy()
|
|
||||||
component.setZoom(ZoomSetting.PageWidth)
|
|
||||||
expect(component.isZoomSelected(ZoomSetting.One)).toBeTruthy()
|
|
||||||
expect(component.isZoomSelected(ZoomSetting.PageFit)).toBeFalsy()
|
|
||||||
component.setZoom(ZoomSetting.Quarter)
|
component.setZoom(ZoomSetting.Quarter)
|
||||||
expect(component.isZoomSelected(ZoomSetting.Quarter)).toBeTruthy()
|
expect(component.currentZoom).toEqual(ZoomSetting.Quarter)
|
||||||
expect(component.isZoomSelected(ZoomSetting.PageFit)).toBeFalsy()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support updating notes dynamically', () => {
|
it('should support updating notes dynamically', () => {
|
||||||
|
@ -1099,12 +1099,10 @@ export class DocumentDetailComponent
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
isZoomSelected(setting: ZoomSetting): boolean {
|
get currentZoom() {
|
||||||
if (this.previewZoomScale === ZoomSetting.PageFit) {
|
if (this.previewZoomScale === ZoomSetting.PageFit) {
|
||||||
return setting === ZoomSetting.PageFit
|
return ZoomSetting.PageFit
|
||||||
}
|
} else return this.previewZoomSetting
|
||||||
|
|
||||||
return this.previewZoomSetting === setting
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getZoomSettingTitle(setting: ZoomSetting): string {
|
getZoomSettingTitle(setting: ZoomSetting): string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user