From: Vincent Vanwaelscappel Date: Thu, 21 Mar 2024 13:32:49 +0000 (+0100) Subject: wait #6818 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2f72fa84c8c88425647ceb7af0365f513b0f0e14;p=fluidbook-html5.git wait #6818 @0.75 --- diff --git a/js/libs/fluidbook/fluidbook.contentlock.js b/js/libs/fluidbook/fluidbook.contentlock.js index ea872e96..cac0e378 100644 --- a/js/libs/fluidbook/fluidbook.contentlock.js +++ b/js/libs/fluidbook/fluidbook.contentlock.js @@ -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) {