]> _ Git - fluidbook-html5.git/commitdiff
fix #3138 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Oct 2019 14:24:08 +0000 (16:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Oct 2019 14:24:08 +0000 (16:24 +0200)
js/libs/fluidbook/fluidbook.help.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.mobilefirst.js
style/mobilefirst.less

index a763211f1e51b7221974848615bd12058d5442cd..9f3633ac182f1689c4ebb11b152ce9e446b57f6f 100644 (file)
@@ -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 '';
         }
 
index 7c42272f074179a0a8519ca2560d126e04fd3fa0..fe73442a0fbe7a4b959b8c4243e91a3332863e4e 100644 (file)
@@ -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);
index 334338b3ce90d8af4caa950f9832fcf22e5c0411..908f333821e9ae658fe772d588372ab303a52e5b 100644 (file)
@@ -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('<div id="scroll"></div>');
@@ -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 () {
index 76572cef758d24c015e92fb15d77ea68191e32bd..676c8317e6afc9ea86806048b98a4f9efd9cb6e3 100644 (file)
     padding: 36px 0;
 
     &.toreveal {
+      transition: none;
       opacity: 0;
       top: 3em;
     }