]> _ Git - fluidbook-html5.git/commitdiff
try #2270 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 25 Sep 2018 17:17:29 +0000 (19:17 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 25 Sep 2018 17:17:29 +0000 (19:17 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.resize.js

index 85e0765c68512c2266e6dc74e72dc1d391246a3e..3052da2d2bcfaaaf1d5784046d928a4a9e7f9cf2 100644 (file)
@@ -102,9 +102,9 @@ Fluidbook.prototype = {
         this.initKeyboardShortcuts();
     },
 
-    initMaxPage:function(){
-        var $this=this;
-        key('⌘+alt+r, ctrl+alt+u', function(){
+    initMaxPage: function () {
+        var $this = this;
+        key('⌘+alt+r, ctrl+alt+u', function () {
             $this.setMaxPage(0);
         });
 
@@ -197,6 +197,7 @@ Fluidbook.prototype = {
     },
     _hideSplash: function () {
         $("#main,#viewOverlay,#view").css('visibility', 'visible');
+        this.resize.resize(false, true);
         this.hideLoader(0, true);
 
         if (this.support.transitions2d) {
index 922d40c62d8108045547a7a9a23693d1b2195b11..130b840a0e1ca8ee9d07e7f5edb656dcef8a85e8 100644 (file)
@@ -70,14 +70,17 @@ FluidbookResize.prototype = {
             });
         }
     },
-    resize: function (init) {
+    resize: function (init, forceOrientation) {
         if (init == undefined || init == null) {
             init = false;
         }
+        if (forceOrientation === undefined) {
+            forceOrientation = false;
+        }
 
         var $this = this;
         this.updateWindow();
-        this.handleOrientation();
+        this.handleOrientation(init || forceOrientation);
 
         if (this.fluidbook.support.android) {
             this.fluidbook.viewport.width = 'device-width';
@@ -335,8 +338,11 @@ FluidbookResize.prototype = {
         this.updateWindow();
         this.fluidbook.menu.resize(this.ww, this.hh);
     },
-    handleOrientation: function () {
+    handleOrientation: function (forceChange) {
         var $this = this;
+        if (forceChange === undefined) {
+            forceChange = false;
+        }
 
         var o = this.fluidbook.support.getOrientation();
         var newo;
@@ -357,13 +363,10 @@ FluidbookResize.prototype = {
             $('body').removeClass('portrait');
         }
 
-        console.log(newo);
 
-        var changeOrientation = this.orientation !== newo;
+        var changeOrientation = forceChange || this.orientation !== newo;
         var force = this.fluidbook.datas.mobileNavigationType != 'book';
-        if (!force && this.orientation == newo) {
-            return;
-        }
+
         this.orientation = newo;
 
         $('body').addClass(this.orientation);