From b50adb108c722263837c55c89749b74641c8badb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 28 May 2019 15:01:15 +0200 Subject: [PATCH] fix #2792 @0:10 --- js/libs/fluidbook/fluidbook.pagetransitions.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.pagetransitions.js b/js/libs/fluidbook/fluidbook.pagetransitions.js index 1e50fa56..60367b35 100644 --- a/js/libs/fluidbook/fluidbook.pagetransitions.js +++ b/js/libs/fluidbook/fluidbook.pagetransitions.js @@ -264,9 +264,12 @@ FluidbookPageTransition.prototype = { if (center) { if (newPage <= 1) { res.center = -1; - } else if (this.fluidbook.datas.pages % 2 == 0 && newPage == this.fluidbook.datas.pages) { + } else if (this.fluidbook.datas.pages % 2 === 0 && newPage === this.fluidbook.datas.pages) { res.center = 1; } + if (this.fluidbook.l10n.dir === 'rtl') { + res.center *= -1; + } } res.loading = [res.currentLeft, res.currentRight]; @@ -282,18 +285,18 @@ FluidbookPageTransition.prototype = { }, centerBook: function (center, animationDuration) { - var animate = animationDuration != undefined && animationDuration > 0; + var animate = animationDuration !== undefined && animationDuration > 0; var move = $("#center-fluidbook,#center-shadow"); var currentLeft = $("#center-fluidbook").data('left'); var left = 0; - if (center == undefined) { + if (center === undefined) { center = $("#center-fluidbook").data('center'); } - if (center != 0) { + if (center !== 0) { left = this.fluidbook.resize.centerOffset * center; } - if (currentLeft == left) { + if (currentLeft === left) { return; } -- 2.39.5