From: Vincent Vanwaelscappel Date: Thu, 1 Dec 2022 16:44:59 +0000 (+0100) Subject: wait #5620 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1f6feedc89c9057c73b29edf82068c708f8b8bbb;p=fluidbook-html5.git wait #5620 @1.5 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index e66a8cb4..1521b308 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -696,15 +696,32 @@ Fluidbook.prototype = { pageSide = $("#currentDoublePage").find('.page').eq(0); } return $(pageSide).data('page'); - }, getDisplayedPages: function () { + }, + + + getDisplayedPages: function (page) { var res = []; - var left = this.getPhysicalPageNumberOfSide('left', true); - var right = this.getPhysicalPageNumberOfSide('right', true); - if (left !== false) { - res.push(left); - } - if (right !== false) { - res.push(right); + if (page === undefined) { + var left = this.getPhysicalPageNumberOfSide('left', true); + var right = this.getPhysicalPageNumberOfSide('right', true); + if (left !== false) { + res.push(left); + } + if (right !== false) { + res.push(right); + } + } else { + if (this.displayOnePage || page == 1) { + res.push(page); + } else { + if (page % 2 == 1) { + res.push(page - 1); + res.push(page); + } else { + res.push(page); + res.push(page + 1); + } + } } return res; }, diff --git a/js/libs/fluidbook/fluidbook.pagetransitions.js b/js/libs/fluidbook/fluidbook.pagetransitions.js index 699dc5b6..67de74ce 100644 --- a/js/libs/fluidbook/fluidbook.pagetransitions.js +++ b/js/libs/fluidbook/fluidbook.pagetransitions.js @@ -300,15 +300,13 @@ FluidbookPageTransition.prototype = { }, centerBookEnabled: function () { - // if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d') { - // return false; - // } - return !!this.fluidbook.settings.centerBook && !this.fluidbook.displayOnePage && $('.tabslink').length === 0; + return !!this.fluidbook.settings.centerBook && + !this.fluidbook.displayOnePage; }, centerBook: function (center, animationDuration) { var animate = animationDuration !== undefined && animationDuration > 0; - var move = $("#center-fluidbook,#center-shadow"); + var move = $("#center-fluidbook,#center-shadow,#l_tabs .tabs"); var currentLeft = $("#center-fluidbook").data('left'); var left = 0; if (center === undefined) { @@ -322,7 +320,7 @@ FluidbookPageTransition.prototype = { return; } - $("#center-fluidbook").data({left: left, center: center}); + $("#center-fluidbook,#l_tabs .tabs").data({left: left, center: center}); if (animate) { $(move).addClass('animate'); @@ -480,7 +478,7 @@ FluidbookPageTransition.prototype = { this.fluidbook.hideLoader(); this.fluidbook.hideUnnecessaryButtons(page); - var animationDuration=this.getTransitionDuration(page); + var animationDuration = this.getTransitionDuration(page); this.fluidbook.updateShadows(page, animationDuration); this.centerBook(turning.center, animationDuration); $("#pagesnumbers").addClass('hidden'); diff --git a/js/libs/fluidbook/fluidbook.tabs.js b/js/libs/fluidbook/fluidbook.tabs.js index 19d4d9f6..30568046 100644 --- a/js/libs/fluidbook/fluidbook.tabs.js +++ b/js/libs/fluidbook/fluidbook.tabs.js @@ -232,7 +232,7 @@ FluidbookTabs.prototype = { } }); } - console.log(page,id); + console.log(page, id); if (id === 'none') { this.svg.find('[id^="o"].active').removeClass('active'); @@ -360,12 +360,13 @@ FluidbookTabs.prototype = { } $(this.fluidbook).on('fluidbook.page.change.start', function (e, page) { - $this.checkPageVisibility(); + $this.checkPageVisibility(page); $this.changePage(page); }); $(this.fluidbook).on('fluidbook.page.change.end', function (e, page) { $this.checkPageVisibility(); + $this.fluidbook.resize.resize(); }); $(document).on('mouseover', '.tablink[data-labelid]', function () { @@ -378,9 +379,9 @@ FluidbookTabs.prototype = { }); }, - checkPageVisibility: function () { + checkPageVisibility: function (page) { var $this = this; - var pages = this.fluidbook.getDisplayedPages(); + var pages = this.fluidbook.getDisplayedPages(page); var hide = false; $.each(pages, function (k, p) { if ($this.hideOnPages.indexOf(p) >= 0) { @@ -436,6 +437,10 @@ FluidbookTabs.prototype = { } else if (this.align === 'left') { css.left = data.fluidbookrect.left - w - this.margin; } + let centerOffet = this.cont.data('left'); + if (centerOffet !== null && !isNaN(centerOffet)) { + css.left -= centerOffet; + } } // This trick allows to fix a dimension bug in ios @@ -454,6 +459,7 @@ FluidbookTabs.prototype = { $this.svg.css('position', 'relative'); }, 100); } + console.log(css); this.cont.css(css); }, }; diff --git a/style/fluidbook.less b/style/fluidbook.less index 32a0756f..c3b9b6c7 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -824,7 +824,7 @@ body, html { /* Center */ -#center-fluidbook, #center-shadow { +#center-fluidbook, #center-shadow, #l_tabs .tabs { position: absolute; top: 0; left: 0; @@ -1472,6 +1472,7 @@ html.ios body.portrait #interface { &[data-animation-hide] { transition: none; + &.show { transition: none; } @@ -2331,7 +2332,7 @@ ul.chapters.shareList a.level0 .svg-icon { /* multimedia */ .mview { - .multimediaScale{ + .multimediaScale { margin: 0 auto; } diff --git a/style/tabs.less b/style/tabs.less index 0e028653..a4de0c02 100644 --- a/style/tabs.less +++ b/style/tabs.less @@ -38,7 +38,7 @@ } .tabs { - transition: opacity 400ms; + transition: opacity 150ms; position: relative; &.hide {