From: Vincent Vanwaelscappel Date: Wed, 16 Oct 2019 14:24:08 +0000 (+0200) Subject: fix #3138 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=657777599df5197417da12f477a82c8296d6512f;p=fluidbook-html5.git fix #3138 @2 --- diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index a763211f..9f3633ac 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -426,7 +426,6 @@ FluidbookHelp.prototype = { // If bookmark icon isn't present on the side we want, it means that we're on // the first/last page and that side is missing so we can't display the help if (baseElement.length === 0) { - console.log('nobookmark', side, baseElement); return ''; } diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 7c42272f..fe73442a 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -201,7 +201,7 @@ Fluidbook.prototype = { } $(this).trigger('fluidbook.splash.beforehide'); var $this = this; - if (this.support.transitions3dacc && this.datas.mobileTransitions === 'flip3d') { + if (this.support.transitions3dacc && this.datas.mobileTransitions === 'flip3d' && !this.mobilefirst.enabled) { $("#main,#viewOverlay,#view").css('visibility', 'visible'); resize(); this.networkControl.pause(4000); diff --git a/js/libs/fluidbook/fluidbook.mobilefirst.js b/js/libs/fluidbook/fluidbook.mobilefirst.js index 334338b3..908f3338 100644 --- a/js/libs/fluidbook/fluidbook.mobilefirst.js +++ b/js/libs/fluidbook/fluidbook.mobilefirst.js @@ -2,6 +2,8 @@ function FluidbookMobileFirst(fluidbook) { this.fluidbook = fluidbook; this.isScrolling = false; this.enabled = this.fluidbook.datas.mobileNavigationType === 'mobilefirst'; + this.transitioning = false; + this.firstReveal = true; if (this.enabled) { this.fluidbook.displayOnePage = true; $("#fluidbook").wrap('
'); @@ -36,31 +38,35 @@ FluidbookMobileFirst.prototype = { $("#pages .mf-nav").removeClass('hiddenzoom'); }); - $(this.fluidbook).on('fluidbook.page.change.end', function () { - $this.checkScroll(); - }); - this.fluidbook.datas.soundTheme = ''; }, checkScroll: function () { + if (this.transitioning) { + return; + } + this.checkFooterNavReveal(); this.checkLinksReveal(); }, checkFooterNavReveal: function () { - if (!this.fluidbook.pagetransitions.canChangePage()) { + if (this.transitioning) { return; } var nav = $("#pages .mf-nav"); var reveal = $(nav).find('.reveal'); var navrect = nav.get(0).getBoundingClientRect(); if (navrect.top < this.fluidbook.resize.hh && reveal.hasClass('toreveal')) { + reveal.removeClass('toreveal'); } }, checkLinksReveal: function () { + if (this.transitioning) { + return; + } var $this = this; var delay = 800; $("#links .link:not(.revealed):visible, .clinks [data-animation]:not(.revealed)").each(function () { @@ -87,6 +93,7 @@ FluidbookMobileFirst.prototype = { }, beforeTransition: function (page) { + this.transitioning = true; $('#pages .mf-nav').css({opacity: 0}); var $this = this; var dimensions = this.fluidbook.loader.getPageDimensions(page); @@ -114,19 +121,29 @@ FluidbookMobileFirst.prototype = { }, afterTransition: function (page) { + if(!this.transitioning){ + return; + } + $('#pages .mf-nav').remove(); $("#pages").append(this.getFooterNavigation(page)); - setTimeout(function () { - $("#pages .mf-nav").css('opacity', 1); - $('#pages .mf-nav .reveal').addClass('toreveal'); - }, 10); + $("#pages .mf-nav").css('opacity', 1); + $('#pages .mf-nav .reveal').addClass('toreveal'); this.fluidbook.resize.resize(); - var $this = this; - setTimeout(function () { - this.fluidbook.resize.resize(); - }, 1000); + + if (this.transitioning) { + this.transitioning = false; + var $this = this; + setTimeout(function () { + $this.checkScroll(); + }, 200); + + setTimeout(function () { + $this.fluidbook.resize.resize(); + }, 1000); + } }, resize: function () { diff --git a/style/mobilefirst.less b/style/mobilefirst.less index 76572cef..676c8317 100644 --- a/style/mobilefirst.less +++ b/style/mobilefirst.less @@ -298,6 +298,7 @@ padding: 36px 0; &.toreveal { + transition: none; opacity: 0; top: 3em; }