mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Fix zoom behavior and add horizontal scrolling.
This commit is contained in:
parent
d1684d4c89
commit
eed4f0b6fa
@ -146,13 +146,25 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
|
||||
}
|
||||
}
|
||||
|
||||
wheel($event: { deltaY: number }): void {
|
||||
if (!this.activePhoto || this.activePhoto.gridMedia.isVideo()) {
|
||||
wheel($event: { deltaX: number, deltaY: number }): void {
|
||||
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;
|
||||
}
|
||||
if ($event.deltaY < 0) {
|
||||
this.zoomIn();
|
||||
} else {
|
||||
} else if ($event.deltaY > 0) {
|
||||
this.zoomOut();
|
||||
}
|
||||
}
|
||||
@ -537,4 +549,3 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user