From: Vincent Vanwaelscappel Date: Wed, 6 Feb 2019 16:20:04 +0000 (+0100) Subject: #2277 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9cb436e84f0093b431bb73d384a5232e1a5921d5;p=fluidbook-html5.git #2277 --- diff --git a/js/libs/fluidbook/fluidbook.contentlock.js b/js/libs/fluidbook/fluidbook.contentlock.js index 393f28e5..3f9b8ae0 100644 --- a/js/libs/fluidbook/fluidbook.contentlock.js +++ b/js/libs/fluidbook/fluidbook.contentlock.js @@ -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