1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00

Fix zoom behavior and add horizontal scrolling.

This commit is contained in:
veroxzik 2024-02-22 19:18:31 -05:00 committed by GitHub
parent d1684d4c89
commit eed4f0b6fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,13 +146,25 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
} }
} }
wheel($event: { deltaY: number }): void { wheel($event: { deltaX: number, deltaY: number }): void {
if (!this.activePhoto || this.activePhoto.gridMedia.isVideo()) { if (!this.activePhoto) {
return;
}
if ($event.deltaX < 0) {
if (this.navigation.hasPrev) {
this.previousPhoto.emit();
}
} else if ($event.deltaX > 0) {
if (this.navigation.hasNext) {
this.nextMediaManuallyTriggered();
}
}
if (this.activePhoto.gridMedia.isVideo()) {
return; return;
} }
if ($event.deltaY < 0) { if ($event.deltaY < 0) {
this.zoomIn(); this.zoomIn();
} else { } else if ($event.deltaY > 0) {
this.zoomOut(); this.zoomOut();
} }
} }
@ -537,4 +549,3 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
} }
} }