mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Merge pull request #836 from veroxzik/feature/lightbox-mousewheel-improvements
Lightbox: fix mouse wheel behavior and add horizontal scroll feature. fixes #835
This commit is contained in:
commit
7f3056158a
@ -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