From: Vincent Vanwaelscappel Date: Tue, 25 Sep 2018 17:17:29 +0000 (+0200) Subject: try #2270 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2de271db83fa2971caf646808c4f6abcb9a296e0;p=fluidbook-html5.git try #2270 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 85e0765c..3052da2d 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -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) { diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index 922d40c6..130b840a 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -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);