]> _ Git - fluidbook-html5.git/commitdiff
fix #2309 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 11 Dec 2018 14:35:21 +0000 (15:35 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 11 Dec 2018 14:35:21 +0000 (15:35 +0100)
js/libs/fluidbook/fluidbook.js
style/fluidbook.less

index ad928932f5dd849c127c7bd4f86db7ee29cb24b8..ffcd6f60dabfef077c685800539330a1f03e63bd 100644 (file)
@@ -501,12 +501,12 @@ Fluidbook.prototype = {
         }
     },
     updateShadows: function (page, animationDuration) {
-        if (animationDuration == undefined) {
+        if (animationDuration === undefined) {
             animationDuration = 0;
         }
         animationDuration *= 1000;
         var delay, duration;
-        if (animationDuration == 0) {
+        if (animationDuration === 0) {
             delay = 0;
             duration = 0;
         } else {
@@ -514,34 +514,52 @@ Fluidbook.prototype = {
             duration = animationDuration * 0.3;
         }
 
-        var transitionIn = {transitionDuration: duration + 'ms', transitionDelay: delay + 'ms'};
-        var transitionOut = {transitionDuration: (duration * .5) + 'ms', transitionDelay: '0ms'};
-
         var left = true, right = true;
-        if (this.displayOnePage) {
-            right = true;
-        } else {
-            if ((page <= 1 && this.l10n.dir == 'ltr') || (page >= this.contentlock.getMaxPage() && this.l10n.dir == 'rtl')) {
+        if (!this.displayOnePage) {
+            if ((page <= 1 && this.l10n.dir === 'ltr') || (page >= this.contentlock.getMaxPage() && this.l10n.dir === 'rtl')) {
                 left = false;
-            } else if ((page <= 1 && this.l10n.dir == 'rtl') || (page >= this.contentlock.getMaxPage() && this.l10n.dir == 'ltr')) {
+            } else if ((page <= 1 && this.l10n.dir === 'rtl') || (page >= this.contentlock.getMaxPage() && this.l10n.dir === 'ltr')) {
                 right = false;
             }
         }
 
         var s = $("#shadow,#edges");
 
+        var s_in = [];
+        var s_out = [];
+
         if (left) {
-            $(s).children(".left.hidden").css(transitionIn).removeClass('hidden');
+            s_in.push(".left.hidden");
         } else {
-            $(s).children(".left:not('.hidden')").css(transitionOut).addClass('hidden');
+            s_out.push(".left:not('.hidden')");
         }
 
         if (right) {
-            $(s).children(".right.hidden").css(transitionIn).removeClass('hidden');
+            s_in.push(".right.hidden");
         } else {
-            $(s).children(".right:not('.hidden')").css(transitionOut).addClass('hidden');
+            s_out.push(".right:not('.hidden')");
         }
 
+        if (this.support.transitions2d && !this.support.iOS) {
+            var transitionIn = {transitionDuration: duration + 'ms', transitionDelay: delay + 'ms'};
+            var transitionOut = {transitionDuration: (duration * .5) + 'ms', transitionDelay: '0ms'};
+            if (s_in.length > 0) {
+                $(s).children(s_in.join(',')).css(transitionIn).removeClass('hidden');
+            }
+            if (s_out.length > 0) {
+                $(s).children(s_out.join(',')).css(transitionOut).addClass('hidden');
+            }
+
+        } else {
+            if (s_in.length > 0) {
+                setTimeout(function () {
+                    $(s).children(s_in.join(',')).removeClass('hidden');
+                }, delay);
+            }
+            if(s_out.length>0) {
+                $(s).children(s_out.join(',')).addClass('hidden');
+            }
+        }
     },
     showAllButtons: function () {
         $("#next,#previous").addClass('help').show();
index 688fdef5f3dc3c1f1bd15d60909945e3f28f084a..6141636940c2bcbc3b15a6ca743634b28eaf16c9 100644 (file)
@@ -431,7 +431,7 @@ body, html {
 
        .ios & {
                transition-property: none !important;
-               transition-duration: 0 !important;
+               transition-duration:0ms !important;
        }
 
        > .shadow {
@@ -495,6 +495,12 @@ body, html {
 }
 
 #edges {
+
+       .ios & {
+               transition-property: none !important;
+               transition-duration:0ms !important;
+       }
+
        position: absolute;
        top: 0px;
        left: 0px;
@@ -577,6 +583,11 @@ body, html {
                                background-image: url("../images/edges/edge-right-middle.png");
                        }
                }
+
+               .ios & {
+                       transition-property: none !important;
+                       transition-duration:0ms !important;
+               }
        }
 }