]> _ Git - fluidbook-html5.git/commitdiff
wait #1710 @0:10
authorVincent <vincent@cubedesigners.com>
Fri, 15 Dec 2017 14:25:54 +0000 (15:25 +0100)
committerVincent <vincent@cubedesigners.com>
Fri, 15 Dec 2017 14:25:54 +0000 (15:25 +0100)
js/libs/fluidbook/fluidbook.resize.js

index 204db7220667f508d0956e4ee8428a3b6416a0ef..30d31364fd9c5187a4b36e2702e96b1080e962a3 100644 (file)
@@ -11,6 +11,7 @@ function FluidbookResize(fluidbook) {
     this.textScale = 2;
     this.bookScale = 1;
     this.interfaceScale = 1;
+    this.headerScale = 1;
     this.navScale = 1;
     this.ww = $(window).width();
     this.hh = $(window).height();
@@ -77,22 +78,24 @@ FluidbookResize.prototype = {
             this.updateWindow();
         }
 
-        var interfaceScale;
+        var interfaceScale, headerScale;
         if (this.orientation == 'landscape') {
             interfaceScale = Math.min(1, this.ww / this.referenceWidthLandscape, this.hh / this.referenceHeight);
         } else if (this.orientation == 'portrait') {
             var nminwidth = ($("#nav a").length * 51) + 205 + 50;
             var refWidth = Math.max(this.referenceWidthPortrait, nminwidth);
-
-            interfaceScale = Math.min(1, this.ww / refWidth * 0.7, this.hh / this.referenceHeight * 0.7);
+            headerScale = Math.min(1, this.ww / refWidth, this.hh / this.referenceHeight);
+            interfaceScale = Math.min(1, 0.7 * this.ww / refWidth, 0.7 * this.hh / this.referenceHeight);
         }
         this.interfaceScale = interfaceScale;
+        this.headerScale = headerScale;
 
-        var navScale = interfaceScale * parseInt(this.fluidbook.datas.mobileNavScale) / 100;
+        var navScale = headerScale * parseInt(this.fluidbook.datas.mobileNavScale) / 100;
         this.navScale = navScale;
 
         var cssInterfaceScale = [interfaceScale, interfaceScale];
         var cssNavScale = [navScale, navScale];
+        var cssHeaderScale = [headerScale, headerScale];
 
         $("#main,#z").css({
             width: this.ww,