]> _ Git - fluidbook-html5.git/commitdiff
wait #6818 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Mar 2024 13:32:49 +0000 (14:32 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Mar 2024 13:32:49 +0000 (14:32 +0100)
js/libs/fluidbook/fluidbook.contentlock.js

index ea872e96662a1e17023db90713fe1223449f1c0c..cac0e378c5e8f455b8b194bf53428912388e3d51 100644 (file)
@@ -24,6 +24,25 @@ FluidbookContentLock.prototype = {
         }
     },
 
+    reset: function () {
+        this.fluidbook.cache.unset('lock_maxpage');
+        let first = true;
+        let $this = this;
+        let mp = 0;
+        $.each(this.locks, function (k, v) {
+            if (first) {
+                mp = k;
+                first = false;
+            }
+            $this.locks[k].unlocked = 0;
+        });
+
+
+        this.setMaxPage(mp, true);
+        this.fluidbook.setCurrentPage(mp);
+
+    },
+
     getNextLockPage: function () {
         var res = 0;
 
@@ -72,11 +91,10 @@ FluidbookContentLock.prototype = {
 
         var $this = this;
         $.each(this.locks, function (k, v) {
-                if ($this.maxPage > k) {
-                    $this.locks[k].unlocked = 1;
-                }
+            if ($this.maxPage > k) {
+                $this.locks[k].unlocked = 1;
             }
-        );
+        });
 
         this.fluidbook.menu.index.reset();
 
@@ -145,7 +163,7 @@ FluidbookContentLock.prototype = {
         var $this = this;
         var change = false;
 
-        var unlockEvenPages = !this.fluidbook.mobilefirst.enabled;
+        var unlockEvenPages = !this.fluidbook.singleMode;
         var currentPage = $this.fluidbook.currentPage;
 
         $.each(this.locks, function (k, v) {