]> _ Git - fluidbook-html5.git/commitdiff
fix #2712 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 May 2019 12:47:35 +0000 (14:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 May 2019 12:47:35 +0000 (14:47 +0200)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.mobilefirst.js
js/libs/fluidbook/fluidbook.pagetransitions.js

index 6526f36a0ce952a6ed28506b4da59441c0fee800..8c7657d02b304b6a5f47eec975d7a7aec96dc60f 100644 (file)
@@ -246,16 +246,17 @@ FluidbookLoader.prototype = {
         var leftPage = pages[0];
         var rightPage = pages[1];
 
-        if (!immediate) {
-            this.loadLeftPage(leftPage, $(doublePage), function () {
-                $this.loadRightPage(rightPage, $(doublePage), callback);
-            });
-        } else {
+        if (immediate) {
             this.loadLeftPage(leftPage, $(doublePage), function () {
             });
             this.loadRightPage(rightPage, $(doublePage), function () {
             });
             callback();
+
+        } else {
+            this.loadLeftPage(leftPage, $(doublePage), function () {
+                $this.loadRightPage(rightPage, $(doublePage), callback);
+            });
         }
     },
     loadPage: function (pageNr, doublePage, position, callback) {
index f112daa19927b0398c9dab4619d61fdd6bbdb9ea..4d42d2af69f243be490ecada3149ea52afaba095 100644 (file)
@@ -42,16 +42,18 @@ FluidbookMobileFirst.prototype = {
         }
     },
 
-    triggerTransition: function (page) {
-        this.fluidbook.pagetransitions.getTurningPages(page);
-    },
-
     beforeTransition: function (page) {
         $('#pages .mf-nav').css({opacity: 0});
         var $this = this;
         var dimensions = this.fluidbook.loader.getPageDimensions(page);
         var max = Math.max(dimensions.height, $("#currentDoublePage").outerHeight());
-        $("#nextDoublePage .page, #nextDoublePage").css({
+
+        var selector = "#nextDoublePage .page, #nextDoublePage";
+        if ($("#nextDoublePage").length === 0) {
+            selector = '#currentDoublePage .page,#currentDoublePage';
+        }
+
+        $(selector).css({
             height: dimensions.height,
             maxHeight: dimensions.height
         });
index 2b8de5d783f11a4e374e1d40cf7940bbc3cc88b0..1e50fa5698d0428719ebec2248373dbe2d0c1b79 100644 (file)
@@ -339,11 +339,6 @@ FluidbookPageTransition.prototype = {
     },
     pageTransition2DPortrait: function (pageNr) {
         this.transitionning = true;
-
-        if (this.fluidbook.mobilefirst.enabled) {
-            this.fluidbook.mobilefirst.triggerTransition(pageNr);
-        }
-
         var $this = this;
         var turning = this.getTurningPages(pageNr);
         $("#pages").append('<div id="nextDoublePage" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
@@ -374,6 +369,7 @@ FluidbookPageTransition.prototype = {
     },
     pageTransition1D: function (pageNr) {
         var page = pageNr;
+
         var doublePage = $("#currentDoublePage");
         var $this = this;
         if (this.fluidbook.displayOnePage) {