mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-23 01:27:14 +02: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 {
|
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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user