From b9aa3754a02ed9a1fec51eeaad92e4b6f0dc15f1 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 11 Dec 2018 15:35:21 +0100 Subject: [PATCH] fix #2309 @1.5 --- js/libs/fluidbook/fluidbook.js | 46 +++++++++++++++++++++++----------- style/fluidbook.less | 13 +++++++++- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index ad928932..ffcd6f60 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -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(); diff --git a/style/fluidbook.less b/style/fluidbook.less index 688fdef5..61416369 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -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; + } } } -- 2.39.5