]> _ Git - fluidbook-html5.git/commitdiff
done #2288 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Oct 2018 16:37:35 +0000 (18:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Oct 2018 16:37:35 +0000 (18:37 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.resize.js

index f9577e655d74618ded0551a7f5f2078512806308..0ef205478b65b6306e041e589a70841edb31d853 100644 (file)
@@ -40,6 +40,7 @@ Fluidbook.prototype = {
         this.viewport.updateViewport();
         this.desktop = new FluidbookDesktop(this);
         this.share = new FluidbookShare(this);
+        this.firstTransition = true;
         if (Modernizr.ftouch && this.support.transitions2d && this.datas.mobileTransitions != 'none') {
             this.touch = new FluidbookTouch(this);
         }
@@ -59,9 +60,9 @@ Fluidbook.prototype = {
             this.form = new FluidbookBulleForm(this);
         } else if (this.datas.form == 'bourbon') {
             this.form = new FluidbookBourbonForm(this);
-        }  else if(this.datas.form=='avery'){
+        } else if (this.datas.form == 'avery') {
             this.form = new FluidbookAveryForm(this);
-        }else{
+        } else {
             this.form == false;
         }
         this.privacy = new FluidbookPrivacy(this);
@@ -443,6 +444,7 @@ Fluidbook.prototype = {
         return;
     },
     pageTransition: function (pageNr) {
+
         $(this).trigger('fluidbook.beforePageTransition');
 
         this.tooltip.hideTooltip();
@@ -453,8 +455,13 @@ Fluidbook.prototype = {
                 pageNr = 1;
             }
         }
+        console.log('transiton to ' + pageNr);
         pageNr = this.normalizePage(pageNr);
-        if (pageNr == this.normalizePage(this.currentPage) || this.currentPage == -1 || !this.support.transitions2d || this.datas.mobileTransitions == 'none') {
+        if(pageNr===0){
+            throw new Error('!!!');
+        }
+        if (this.firstTransition || pageNr === this.normalizePage(this.currentPage) || this.currentPage === -1 || !this.support.transitions2d || this.datas.mobileTransitions === 'none') {
+            this.firstTransition = false;
             return this.pageTransition1D(pageNr);
         }
         if (this.displayOnePage) {
@@ -927,7 +934,6 @@ Fluidbook.prototype = {
         this._openFile(pdf, button, 'pdf', pdfName, print);
     },
 
-
     _openFile: function (url, e, type, localname, print) {
 
         if (print === undefined) {
index 130b840a0e1ca8ee9d07e7f5edb656dcef8a85e8..951be9ce056385e71c53dbdbd77e1b14d383715b 100644 (file)
@@ -376,7 +376,9 @@ FluidbookResize.prototype = {
             console.warn('Orientation change! ' + this.orientation);
             $(this.fluidbook).trigger('fluidbook.resize.beforeOrientationChange');
             this.fluidbook.zoom.resetZoom();
-            this.fluidbook.pageTransition();
+            if(!this.fluidbook.firstTransition) {
+                this.fluidbook.pageTransition();
+            }
             $(this.fluidbook).trigger('fluidbook.resize.orientation', {orientation: this.orientation});
             if (this.fluidbook.support.android) {
                 setTimeout(function () {