]> _ Git - fluidbook-html5.git/commitdiff
fix #2792 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 May 2019 13:01:15 +0000 (15:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 May 2019 13:01:15 +0000 (15:01 +0200)
js/libs/fluidbook/fluidbook.pagetransitions.js

index 1e50fa5698d0428719ebec2248373dbe2d0c1b79..60367b3555d137c5a1448aef5f74e5cce8152381 100644 (file)
@@ -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;
         }