]> _ Git - fluidbook-html5.git/commitdiff
fix #3142 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Oct 2019 14:49:12 +0000 (16:49 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Oct 2019 14:49:12 +0000 (16:49 +0200)
js/libs/fluidbook/fluidbook.mobilefirst.js
js/libs/fluidbook/fluidbook.resize.js

index c618826bb2808028f2e03970ae1ba08f02bfb1e9..b9251300f1e6cd2d8a69a21271798bd2ace9a1a2 100644 (file)
@@ -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) {
index f7b17dbd2e69168c331f7172e575de340b701044..11276debff4dc85eebd792f7124fb0c186e1f3d0 100644 (file)
@@ -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();