mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Prevent lightbox transition until specific number of scroll events (#2544)
* Delay before nav to next image on scroll * Add config for scroll attempts before transition
This commit is contained in:
@@ -158,6 +158,11 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||
const slideshowDelay =
|
||||
savedDelay ?? configuredDelay ?? DEFAULT_SLIDESHOW_DELAY;
|
||||
|
||||
const scrollAttemptsBeforeChange = Math.max(
|
||||
0,
|
||||
config?.interface.imageLightbox.scrollAttemptsBeforeChange ?? 0
|
||||
);
|
||||
|
||||
function setSlideshowDelay(v: number) {
|
||||
setLightboxSettings({ slideshowDelay: v });
|
||||
}
|
||||
@@ -733,6 +738,8 @@ export const LightboxComponent: React.FC<IProps> = ({
|
||||
onRight={handleRight}
|
||||
alignBottom={movingLeft}
|
||||
zoom={i === currentIndex ? zoom : 1}
|
||||
current={i === currentIndex}
|
||||
scrollAttemptsBeforeChange={scrollAttemptsBeforeChange}
|
||||
setZoom={(v) => setZoom(v)}
|
||||
resetPosition={resetPosition}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user