From 9df824c28af67a0d7c44916a3b871f6fbf269960 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 16 Oct 2019 16:49:12 +0200 Subject: [PATCH] fix #3142 @1 --- js/libs/fluidbook/fluidbook.mobilefirst.js | 4 ++-- js/libs/fluidbook/fluidbook.resize.js | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.mobilefirst.js b/js/libs/fluidbook/fluidbook.mobilefirst.js index c618826b..b9251300 100644 --- a/js/libs/fluidbook/fluidbook.mobilefirst.js +++ b/js/libs/fluidbook/fluidbook.mobilefirst.js @@ -157,8 +157,8 @@ FluidbookMobileFirst.prototype = { $("#pages").css('maxHeight', h); }, - getBookScale: function () { - return Math.min(620, this.fluidbook.resize.ww * 0.9) / this.fluidbook.datas.width; + getBookScale: function (aw) { + return Math.min(620, aw) / this.fluidbook.datas.width; }, getFooterNavigation: function (page) { diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index f7b17dbd..11276deb 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -21,11 +21,11 @@ function FluidbookResize(fluidbook) { FluidbookResize.prototype = { reduceHorizontalMargins: function () { - return this.orientation === 'portrait' && (this.fluidbook.support.iOS || this.fluidbook.support.android); + return this.fluidbook.mobilefirst.enabled || (this.orientation === 'portrait' && (this.fluidbook.support.iOS || this.fluidbook.support.android)); }, setMargins: function () { - var marginV = this.fluidbook.mobilefirst.enabled ? 36 : 20; + var marginV = 20; var marginY = marginV; var marginX = 60; @@ -44,9 +44,10 @@ FluidbookResize.prototype = { // Manage transform origins based on text direction // This is important for the elements to have the correct position after scaling // Note: the #logo is handled in the CSS because it is also affected by the .menu-inverted class + var ltr = this.fluidbook.l10n.dir === 'ltr'; - var left = this.fluidbook.l10n.dir == 'ltr' ? '0%' : '100%'; - var right = this.fluidbook.l10n.dir == 'ltr' ? '100%' : '0%'; + var left = ltr ? '0%' : '100%'; + var right = ltr ? '100%' : '0%'; $("#nav,#searchHints").transform({ origin: [left, '0%'] @@ -158,7 +159,7 @@ FluidbookResize.prototype = { extraX = 0; } - marginTop = (parseInt(this.fluidbook.datas.menuHeight) + this.margintop) * interfaceScale; + marginTop = (parseInt(this.fluidbook.datas.menuHeight) * headerScale) + (this.margintop * interfaceScale); marginBottom = (10 + this.marginbottom) * interfaceScale; marginLeft = (this.marginleft + parseInt(extraX)) * interfaceScale; marginRight = (this.marginright + parseInt(extraX)) * interfaceScale; @@ -175,7 +176,7 @@ FluidbookResize.prototype = { this.bookScale = Math.min(aw / fww, ah / fhh); var origin = ['50%', '50%']; if (this.fluidbook.mobilefirst.enabled) { - this.bookScale = this.fluidbook.mobilefirst.getBookScale(); + this.bookScale = this.fluidbook.mobilefirst.getBookScale(aw); origin[1] = '0%'; } @@ -357,7 +358,7 @@ FluidbookResize.prototype = { }, checkLogoVisibility: function () { - if(this.fluidbook.mobilefirst.enabled){ + if (this.fluidbook.mobilefirst.enabled) { return; } var logo = document.getElementById("logo").getBoundingClientRect(); -- 2.39.5