From 2f72fa84c8c88425647ceb7af0365f513b0f0e14 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 21 Mar 2024 14:32:49 +0100 Subject: [PATCH] wait #6818 @0.75 --- js/libs/fluidbook/fluidbook.contentlock.js | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) 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) { -- 2.39.5