]> _ Git - fluidbook-html5.git/commitdiff
try #2552 @6
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 28 Jan 2019 17:57:12 +0000 (18:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 28 Jan 2019 17:57:12 +0000 (18:57 +0100)
js/libs/fluidbook/fluidbook.pagetransitions.js
js/libs/fluidbook/fluidbook.resize.js
style/fluidbook.less

index e98574ba5d6f03a8fc59e8b70bd157588bd3e140..281910c722c4fc0a5975584093c98ef27adbe5f6 100644 (file)
@@ -164,21 +164,30 @@ FluidbookPageTransition.prototype = {
 
         $this.fluidbook.pauseNetwork(3000);
         var currentDoublePage = $("#currentDoublePage");
+        $("#pages").prepend('<div id="nextDoublePage" class="_3d doublePage"></div>');
+        var doublePage = $("#nextDoublePage");
+
 
         this.fluidbook.loader.preloadPagesBeforeTransition(turning.end, function () {
             $this.flip3d.clean();
             $this.flip3d.prepareTurn(turning, function () {
                 $this.beforeTransition(pageNr, 3, turning);
                 $this.flip3d.initTurn(turning.dir);
-                setTimeout(function(){
+                setTimeout(function () {
                     $this.fluidbook.loader.setContentsInDoublePage(currentDoublePage, turning.flat, true, function () {
                         $this.flip3d.playTurn(turning.dir, function () {
-                            $this.fluidbook.loader.setContentsInDoublePage(currentDoublePage, turning.end, true, function () {
+                            $this.fluidbook.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
+                                if ($this.transitionning == false) {
+                                    return;
+                                }
+                                // Remove former part
+                                $("#currentDoublePage").remove();
+                                $(doublePage).attr('id', 'currentDoublePage').removeClass('_3d');
                                 $this.afterTransition(pageNr);
                             });
                         });
                     });
-                },10);
+                }, 10);
             });
         });
     },
@@ -348,12 +357,12 @@ FluidbookPageTransition.prototype = {
             $this.afterTransition(page);
         });
     },
-    beforeTransition: function (page, d, turning) {
-        if (d == undefined) {
-            d = 1;
+    beforeTransition: function (page, transition, turning) {
+        if (transition == undefined) {
+            transition = 1;
         }
         $(this.fluidbook).trigger('fluidbook.page.change.start', [page, {
-            transition: d,
+            transition: transition,
             page: page,
             turningPages: turning.flip
         }]);
@@ -364,7 +373,7 @@ FluidbookPageTransition.prototype = {
         $("#links").hide();
         this.fluidbook.hideLoader();
         this.fluidbook.hideUnnecessaryButtons(page);
-        var animationDuration = d <= 1 ? 0 : parseFloat(this.fluidbook.datas.mobileTransitionDuration);
+        var animationDuration = transition <= 1 ? 0 : parseFloat(this.fluidbook.datas.mobileTransitionDuration);
         this.fluidbook.updateShadows(page, animationDuration);
         this.centerBook(turning.center, animationDuration);
         $("#pagesnumbers").addClass('hidden');
@@ -393,7 +402,7 @@ FluidbookPageTransition.prototype = {
         setTimeout(function () {
             $this.fluidbook.loader.preloadAround(page);
         }, 1000);
-        this.fluidbook.links.initLinks();
+
         this.fluidbook.hideLoader();
         this.fluidbook.resetWaiters();
         this.fluidbook.updateShadows(page, 0);
@@ -430,7 +439,8 @@ FluidbookPageTransition.prototype = {
 
         setTimeout(function () {
             $this.transitionning = false;
-        }, 10)
+        }, 10);
+        this.fluidbook.links.initLinks();
         $(this.fluidbook).trigger('fluidbook.page.change.end', [this.fluidbook.currentPage]);
     },
 
index 23146210b6f9accc27cb2c695228beb02693d0f8..0997ebd70976d0ca6b569fe086511d970356f06e 100644 (file)
@@ -173,6 +173,11 @@ FluidbookResize.prototype = {
             scale: [this.bookScale, this.bookScale],
             origin: ['50%', '50%']
         });
+
+        // Hack to fix #2552
+        if (this.fluidbook.support.iOS && this.fluidbook.support.transitions3dacc) {
+            $('#fluidbook').css('transform', 'translate3d(0,0,-1px) scale(' + this.bookScale + ',' + this.bookScale + ')');
+        }
         var top = marginTop + (ah - fhh) / 2;
         var left = marginLeft + (aw - fww) / 2;
         $("#fluidbook,#shadow").css({
index 729936fcc252912c4ee00bde51c1b0b4e513682f..8a686508d6524d08a18cd6bc594a312163edd34b 100644 (file)
@@ -638,6 +638,7 @@ body, html {
 @import "slider";
 
 /* Center */
+
 #center-fluidbook, #center-shadow {
        position: absolute;
        top: 0;
@@ -2243,6 +2244,10 @@ ul.chapters {
        }
 }
 
+.ios #pages {
+       transform: translateZ(1);
+}
+
 /* 3D */
 #pages._3dtransition {
        -moz-perspective-origin: 50% 75%;