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('<div id="scroll"></div>');
$("#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 () {
},
beforeTransition: function (page) {
+ this.transitioning = true;
$('#pages .mf-nav').css({opacity: 0});
var $this = this;
var dimensions = this.fluidbook.loader.getPageDimensions(page);
},
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 () {