]> _ Git - fluidbook-html5.git/commitdiff
wait #4352 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Mar 2021 19:54:09 +0000 (20:54 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Mar 2021 19:54:09 +0000 (20:54 +0100)
js/libs/fluidbook/fluidbook.contentlock.js

index 0d367a3f6e9e105eeb51b3ec30152325348afdf0..38bcb8841ec7cce70c89a14c55a373dc0183c523 100644 (file)
@@ -13,7 +13,12 @@ FluidbookContentLock.prototype = {
             $this.setMaxPage();
         });
 
+
         this.maxPage = Math.min(this.getNextLockPage(), this.fluidbook.settings.pages);
+        if (!this.fluidbook.scorm.isActive() && this.fluidbook.cache.isset('lock_maxpage')) {
+            var mp = parseInt(this.fluidbook.cache.get('lock_maxpage'));
+            this.maxPage = Math.max(this.maxPage, mp);
+        }
         if (this.maxPage <= 0) {
             this.maxPage = this.fluidbook.settings.pages;
         }
@@ -49,6 +54,9 @@ FluidbookContentLock.prototype = {
         if (currentMaxPage === this.maxPage) {
             return;
         }
+        if (!this.fluidbook.scorm.isActive()) {
+            this.fluidbook.cache.set('lock_maxpage', this.maxPage);
+        }
         $(this.fluidbook).trigger('fluidbook.maxpage.set', [this.maxPage]);
         this.updateMaxPage();
     },