]> _ Git - fluidbook-html5.git/commitdiff
fix #3657 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 May 2020 12:23:27 +0000 (14:23 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 25 May 2020 12:23:27 +0000 (14:23 +0200)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.slideshow.js

index 363c3605bdb065ce8b8519eb1f3c432574ea1989..f51f082f8a4c69c83f9dd9a3c86e6c10b5b4c58e 100644 (file)
@@ -461,7 +461,7 @@ FluidbookLinks.prototype = {
             tweenmax = false;
         }
         css = $.extend({zIndex: 500 + parseInt(animation.zindex)}, css);
-        console.log(css);
+
         link.css(css);
         link.show();
         if (tweenmax) {
index a838c44812e30695cbfaa324d7f00ad04e849be8..a1fe3cf4da5c1906e22c4c38684eb9fcfde9dc8f 100644 (file)
@@ -1,16 +1,25 @@
 function FluidbookSlideshow(fluidbook) {
     this.fluidbook = fluidbook;
+    this.numSlides = 0;
 }
 
 FluidbookSlideshow.prototype = {
     initSlideshow: function (id) {
-        var $this=this;
+        var $this = this;
         var $slideshow = $('#' + id);
         var thumbnailsID = id + '_thumbnails';
         var $thumbnails;
         var showThumbnails = $slideshow.attr('data-thumbnails') === '1';
 
-        if ($slideshow.length == 0) return false;
+        if ($slideshow.length == 0) {
+            return false;
+        }
+
+        this.numSlides = $slideshow.find('img').length;
+
+        console.log(this.numSlides);
+
+        showThumbnails = showThumbnails && numSlides > 1;
 
         var openIndex = parseInt($slideshow.attr('data-open-index'));
         if (isNaN(openIndex)) {
@@ -33,7 +42,7 @@ FluidbookSlideshow.prototype = {
 
         var slideshowParams = {
             variableWidth: false,
-            infinite: true,
+            infinite: this.numSlides > 1,
             draggable: true
         };
         if (showThumbnails) {