From: Vincent Vanwaelscappel Date: Thu, 28 Nov 2019 19:42:43 +0000 (+0100) Subject: wait #3186 @0:45 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6f058f0e60eedb09f5b919e348f4ed67a4384d76;p=fluidbook-html5.git wait #3186 @0:45 --- diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index 4459ad4b..26ef5c45 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -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; diff --git a/js/libs/fluidbook/fluidbook.tabs.js b/js/libs/fluidbook/fluidbook.tabs.js index 3a2a2df9..7e877704 100644 --- a/js/libs/fluidbook/fluidbook.tabs.js +++ b/js/libs/fluidbook/fluidbook.tabs.js @@ -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 = $(''); $this.cont.append(l); l.css(commoncss); l.css(v.css); + if (v.page) { l.attr('href', '#/page/' + v.page); }