]> _ Git - fluidbook-html5.git/commitdiff
wait #4083 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 Nov 2020 16:02:34 +0000 (17:02 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 Nov 2020 16:02:34 +0000 (17:02 +0100)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js

index c80b0961c72097a5aea1a36745f48c9c6c39b399..19871357d44669b5ba077270eabe94449cc61950 100644 (file)
@@ -684,8 +684,12 @@ FluidbookLoader.prototype = {
         $(image).one('error', function () {
             callback();
         });
+        if ($(image).length === 0) {
+            callback();
+            return;
+        }
         var img = $(image).get(0);
-        if (img.complete || img.readyState === 'complete' || img.readyState === 4) {
+        if (img===undefined || img.complete || img.readyState === 'complete' || img.readyState === 4) {
             callback();
         }
     },
index b8a16fd6955fa2800502213acc4050b81f2e42bb..b4a9f1c5817f492f2128a30690dd815989b487c6 100644 (file)
@@ -44,7 +44,16 @@ FluidbookVacheronSlideshow.prototype = {
             this.gotoIndex(0, s);
         }
 
-        this.fluidbook.loader.callWhenLoaded($(s).find('.fb-slideshow-slide:eq(1) img'), function () {
+        if (i <= 1) {
+            $(nav).css('visibility', 'hidden');
+        }
+
+        var j = 1;
+        if (i == 0) {
+            j = 0;
+        }
+
+        this.fluidbook.loader.callWhenLoaded($(s).find('.fb-slideshow-slide:eq(' + j + ') img'), function () {
             setTimeout(function () {
                 $(s).addClass('ready');
             }, 100)
@@ -64,15 +73,12 @@ FluidbookVacheronSlideshow.prototype = {
     },
 
     gotoIndex: function (i, s) {
-        console.log('gotoindex', i, s);
         var $this = this;
         if ($(s).data('animating')) {
-            console.log('already animating');
             return;
         }
         i = this.normalizeIndex(i, $(s).data('nbslides'));
         if (i === $(s).data('currentIndex')) {
-            console.log('already index');
             return;
         }
         $(s).data('animating', true);