Skip to content

Commit cf8504f

Browse files
committed
Fix resume behavior
- Issue: resume hotkey doesn't work if slideshow stops on the last image - Intended behavior: if slideshow stops on the last image, pressing Resume will start the slideshow again
1 parent 54f3d2a commit cf8504f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

BrowserImageSlideshow.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
function update() {
8989
if (index === images.length-1 && stopOnLastImage === true) {
9090
clearInterval(slideshowFunc);
91+
isSlideshowPaused = true;
9192
return;
9293
}
9394
getNextSlide();
@@ -146,7 +147,7 @@
146147

147148
function resume() {
148149
if (!isSlideshowPaused) return;
149-
update(); // trigger a single update to fill setInterval delay
150+
getNextSlide(); // get next slide without waiting for setInterval delay
150151
slideshowFunc = setInterval(update, slideDuration);
151152
isSlideshowPaused = false;
152153
}

0 commit comments

Comments
 (0)