Zoom: prevent page zooming

This commit is contained in:
Eduard Kuzmenko 2021-08-21 00:55:59 +03:00
parent 47c623a3bd
commit 60a8834fea
1 changed files with 6 additions and 3 deletions

View File

@ -494,8 +494,10 @@ class AppMediaViewerBase<ContentAdditionType extends string, ButtonsAdditionType
this.buttons.next.click();
} else if(e.key === 'ArrowLeft') {
this.buttons.prev.click();
} else if(this.ctrlKeyDown && (e.key === '-' || e.key === '=')) {
this.changeZoom(e.key === '=');
} else if(e.key === '-' || e.key === '=') {
if(this.ctrlKeyDown) {
this.changeZoom(e.key === '=');
}
} else {
good = false;
}
@ -520,8 +522,9 @@ class AppMediaViewerBase<ContentAdditionType extends string, ButtonsAdditionType
};
private onWheel = (e: WheelEvent) => {
cancelEvent(e);
if(this.ctrlKeyDown) {
cancelEvent(e);
const scrollingUp = e.deltaY < 0;
this.changeZoom(!!scrollingUp);
}