]> _ Git - fluidbook-html5.git/commitdiff
fix #3661 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 May 2020 17:36:29 +0000 (19:36 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 May 2020 17:36:29 +0000 (19:36 +0200)
js/libs/fluidbook/fluidbook.contentlock.js

index 7b80544271dd1ff6f4526700378467844f4b4c1f..29e357016df1665da0a8821dff240917370b1830 100644 (file)
@@ -130,16 +130,20 @@ FluidbookContentLock.prototype = {
     unlockCurrentPage: function () {
         var $this = this;
         var change = false;
+
+        var unlockEvenPages = !this.fluidbook.mobilefirst.enabled;
+        var currentPage = $this.fluidbook.currentPage;
+
         $.each(this.locks, function (k, v) {
             if (v.unlocked === 1) {
                 return;
             }
-            var currentPage = $this.fluidbook.currentPage;
-            if (currentPage % 2 === 1) {
+
+            if (unlockEvenPages && currentPage % 2 === 1) {
                 currentPage--;
             }
-            var lockPage = k;
-            if (lockPage % 2 === 1) {
+            var lockPage = parseInt(k);
+            if (unlockEvenPages && lockPage % 2 === 1) {
                 lockPage--;
             }
             if (currentPage !== lockPage) {