]> _ Git - fluidbook-html5.git/commitdiff
wait #5620 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 1 Dec 2022 16:44:59 +0000 (17:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 1 Dec 2022 16:44:59 +0000 (17:44 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.pagetransitions.js
js/libs/fluidbook/fluidbook.tabs.js
style/fluidbook.less
style/tabs.less

index e66a8cb4c5ac87bb335af9c874dcdcebb7e58ea4..1521b308480c0be718bdfc0be6d9085bf7bc759e 100644 (file)
@@ -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;
     },
index 699dc5b63c2abd45e7b92e7940e3826cc87023de..67de74ce3579f4bd2f68b3a4b7edce7643fa22de 100644 (file)
@@ -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');
index 19d4d9f698d776e8e4dd99bcd7b2c933b9a6152c..30568046e65e1028522815dbf44ff6fb5500c4af 100644 (file)
@@ -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);
     },
 };
index 32a0756f85848bb76a74bc988bd63fd6f88005db..c3b9b6c7ec03a25a63746d07a0478b8738d2cfad 100644 (file)
@@ -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;
   }
 
index 0e028653951c6f9f2df24527c7653e745c289b29..a4de0c028102649688956cf3cf531cd47a6cbd90 100644 (file)
@@ -38,7 +38,7 @@
   }
 
   .tabs {
-    transition: opacity 400ms;
+    transition: opacity 150ms;
     position: relative;
 
     &.hide {