From: Vincent Vanwaelscappel Date: Mon, 30 Nov 2020 16:02:34 +0000 (+0100) Subject: wait #4083 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=10013584d611d47d31701be8dc48e3b386967e36;p=fluidbook-html5.git wait #4083 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index c80b0961..19871357 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -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(); } }, diff --git a/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js b/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js index b8a16fd6..b4a9f1c5 100644 --- a/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js +++ b/js/libs/fluidbook/slideshow/fluidbook.slideshow.vacheron.js @@ -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);