]> _ Git - fluidbook-html5.git/commitdiff
fix #3131 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Oct 2019 13:26:01 +0000 (15:26 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Oct 2019 13:26:01 +0000 (15:26 +0200)
js/libs/fluidbook/fluidbook.slideshow.js

index 831e12b83a6a10313e6fc1f7c0db04616fc639bd..982758379e0abaf6af4c884c48c8adddfc004cda 100644 (file)
@@ -11,6 +11,12 @@ FluidbookSlideshow.prototype = {
 
         if ($slideshow.length == 0) return false;
 
+        var openIndex = parseInt($slideshow.attr('data-open-index'));
+        if (isNaN(openIndex)) {
+            openIndex = 1;
+        }
+        openIndex--;
+
 
         // Dynamically add thumbnails from full sized images
         // Images have to load anyway so we can reuse full images for thumbnails
@@ -33,7 +39,10 @@ FluidbookSlideshow.prototype = {
             slideshowParams.asNasFor = '#' + thumbnailsID; // Synced with thumbnails slider
         }
         // Main image slider
-        $slideshow.slick(slideshowParams);
+        var mainSlideshow = $slideshow.slick(slideshowParams);
+        if (openIndex > 0) {
+            $slideshow.slick('slickGoTo', openIndex, true);
+        }
 
         if (showThumbnails) {
             // Thumbnails slider