]> _ Git - fluidbook-html5.git/commitdiff
#2277
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Feb 2019 16:20:04 +0000 (17:20 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Feb 2019 16:20:04 +0000 (17:20 +0100)
js/libs/fluidbook/fluidbook.contentlock.js

index 393f28e59db0011625d47f5450c1ff3ed764eff1..3f9b8ae07e9a902e7629674451e43acd20ae5029 100644 (file)
@@ -111,7 +111,7 @@ FluidbookContentLock.prototype = {
         });
 
         if (change || this.getNextLockPage() !== this.getMaxPage()) {
-            this.unlockNextPage();
+            this.setMaxPage(this.getNextLockPage(), false);
         }
     },
 
@@ -127,6 +127,19 @@ FluidbookContentLock.prototype = {
     },
 
     unlockNextPage: function () {
-        this.setMaxPage(this.getNextLockPage(), false)
+        $.each(this.locks, function (k, v) {
+            if (v.unlocked === 1) {
+                return;
+            }
+            if (v.conditions.length === 0) {
+                return;
+            }
+
+            $this.locks[k].unlocked = 1;
+            return true;
+        });
+        if (this.getNextLockPage() !== this.getMaxPage()) {
+            this.setMaxPage(this.getNextLockPage(), false);
+        }
     }
 }
\ No newline at end of file