]> _ Git - fluidbook-html5.git/commitdiff
fix #2553 @4
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Jan 2019 15:38:22 +0000 (16:38 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Jan 2019 15:38:22 +0000 (16:38 +0100)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.pagetransitions.js
js/libs/fluidbook/fluidbook.resize.js
style/fluidbook.less

index a7303047becea8802bfeead66405324fc0ebb593..8a8ecec5973c10c5b195184e22ccc126df8ef632 100644 (file)
@@ -601,6 +601,7 @@ FluidbookLinks.prototype = {
     },
 
     initSlideshow: function (s) {
+        var $this = this;
         s.data('init', true);
         var dir = 'data/links/' + $(s).data('dir') + '/';
         $.each($(s).data('images'), function (k, i) {
@@ -609,18 +610,29 @@ FluidbookLinks.prototype = {
         });
 
         setTimeout(function () {
-            s.find('.slide:eq(0)').addClass('show');
-        }, 1000);
+            var s0 = s.find('.slide:eq(0)');
+            s0.css('display', 'block');
+            setTimeout(function () {
+                s0.addClass('show');
+            }, 10);
+        }, 4000);
 
         this.initInlineSlideshowsIntervals.push(setInterval(function () {
-            var current = s.find('.slide.show');
+            var current = s.find('.slide.show').eq(0);
             var next = $(current).nextAll('.slide:not(.show):eq(0)');
-            if ($(next).length == 0) {
+            if ($(next).length === 0) {
                 next = s.find('.slide:eq(0)');
             }
 
-            $(next).addClass('show');
-            $(current).removeClass('show');
+            $(next).css({display: 'block', zIndex: 2});
+
+            setTimeout(function () {
+                $(next).addClass('show').one($this.fluidbook.support.getTransitionEndEvent(), function () {
+                    $(current).removeClass('show').css('display', 'none');
+                    $(this).css({zIndex: ''});
+                });
+            }, 100);
+
         }, parseFloat(this.fluidbook.datas.inlineSlideshowDuration) * 1000));
     },
 
index 281910c722c4fc0a5975584093c98ef27adbe5f6..668592ccdb09ad929b584aee87333bcc77b2da29 100644 (file)
@@ -36,13 +36,17 @@ FluidbookPageTransition.prototype = {
     },
 
     getTransitionType: function (pageNr) {
-        pageNr = this.normalizeTransitionPageNr(pageNr);
+        if (pageNr !== undefined) {
+            pageNr = this.normalizeTransitionPageNr(pageNr);
 
-        if (pageNr === this.fluidbook.normalizePage(this.fluidbook.currentPage) ||
-            this.fluidbook.currentPage === -1 ||
-            !this.fluidbook.support.transitions2d ||
+            if (pageNr === this.fluidbook.normalizePage(this.fluidbook.currentPage) ||
+                this.fluidbook.currentPage === -1) {
+                return "immediate";
+            }
+        }
+        if (!this.fluidbook.support.transitions2d ||
             this.fluidbook.datas.mobileTransitions === 'none') {
-            return "immediate";
+            return 'immediate';
         }
         if (this.fluidbook.displayOnePage) {
             return 'portrait';
index 0997ebd70976d0ca6b569fe086511d970356f06e..ce869c8383cc359fccc9f8143ae1cc9b945d02f4 100644 (file)
@@ -175,7 +175,7 @@ FluidbookResize.prototype = {
         });
 
         // Hack to fix #2552
-        if (this.fluidbook.support.iOS && this.fluidbook.support.transitions3dacc) {
+        if (this.fluidbook.support.iOS && this.fluidbook.pagetransitions.getTransitionType() === 'flip3d') {
             $('#fluidbook').css('transform', 'translate3d(0,0,-1px) scale(' + this.bookScale + ',' + this.bookScale + ')');
         }
         var top = marginTop + (ah - fhh) / 2;
index 9693ba85a480f6041d1ff4d82ff8509709fb3a4b..d8e662343586fff12c73f6a7c7777dd52425a9de 100644 (file)
@@ -2751,18 +2751,22 @@ body > input {
        overflow: hidden;
 
        .slide {
+               display: none;
                width: 100%;
                height: 100%;
                background-size: cover;
                background-position: 50% 50%;
                opacity: 0;
-               transition: opacity @inlineslideshow-transition-time;
+
                position: absolute;
                top: 0;
                left: 0;
+               z-index: 0;
 
                &.show {
+                       z-index: 1;
                        opacity: 1;
+                       transition: opacity @inlineslideshow-transition-time;
                }
        }
 }