]> _ Git - fluidbook-html5.git/commitdiff
wait #3186 @0:45
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 28 Nov 2019 19:42:43 +0000 (20:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 28 Nov 2019 19:42:43 +0000 (20:42 +0100)
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.tabs.js

index 4459ad4b78486f2bd6953cf0d4251059be63bfc8..26ef5c45f26ca331b5f55ba2b0abde6330c98147 100644 (file)
@@ -36,7 +36,7 @@ FluidbookResize.prototype = {
         this.marginleft = marginX + parseInt(this.fluidbook.datas.extraXSpace);
         this.margintop = marginY + parseInt(this.fluidbook.datas.extraYSpace);
         this.marginbottom = marginY + marginV;
-        this.marginright = marginX + parseInt(this.fluidbook.datas.extraXSpace);
+        this.marginright = this.marginleft;
     },
 
     init: function () {
@@ -179,8 +179,10 @@ FluidbookResize.prototype = {
             this.bookScale = this.fluidbook.mobilefirst.getBookScale(aw);
             origin[1] = '0%';
         }
-        
-        this.bookScale *= this.fluidbook.tabs.guessBookScale(this.bookScale, aw, fww);
+
+        var tabsScale = this.fluidbook.tabs.guessBookScale(this.bookScale, aw, fww);
+        console.log('tabsScale', tabsScale);
+        this.bookScale *= tabsScale;
 
         var fw = this.bookScale * fww;
         var fh = this.bookScale * fhh;
index 3a2a2df9d629bb9a66542b5899c1c714ee8126e1..7e87770461b857e8e3750016d17cb726a879dd7d 100644 (file)
@@ -37,6 +37,7 @@ FluidbookTabs.prototype = {
     guessTabsWidth: function (bookScale) {
         var fh = this.fluidbook.datas.height * bookScale;
         var tabsScale = fh / this.naturalDimensions.height;
+
         return this.linkWidth * tabsScale;
     },
 
@@ -242,14 +243,16 @@ FluidbookTabs.prototype = {
         var $this = this;
 
         var commoncss = {};
-        var widthPct = (100 * (this.linkWidth / this.naturalDimensions.width)) + "%";
-        commoncss.width = widthPct;
+        commoncss.width = (100 * (this.linkWidth / this.naturalDimensions.width)) + "%";
+        commoncss.left = (-100 * (this.margin / this.naturalDimensions.width)) + "%";
+        console.log(commoncss);
 
         $(this.links).each(function (k, v) {
             var l = $('<a class="tablink" />');
             $this.cont.append(l);
             l.css(commoncss);
             l.css(v.css);
+
             if (v.page) {
                 l.attr('href', '#/page/' + v.page);
             }