]> _ Git - fluidbook-html5.git/commitdiff
wip #6531 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Nov 2023 16:24:53 +0000 (17:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Nov 2023 16:24:53 +0000 (17:24 +0100)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.search.js

index 25dcaeb0546d425ba525b38ba5aa26cd9dc14da5..7fbae47183695d3b21da51c70ac60b2b3e57b19e 100644 (file)
@@ -272,12 +272,12 @@ FluidbookLoader.prototype = {
             return;
         }
 
-        var numPreloadAfter = 10;
-        var numPreloadBefore = 4;
+        var numPreloadBefore = Math.ceil(this.fluidbook.settings.preload / 4);
+        var numPreloadAfter = this.fluidbook.settings.preload;
 
         if (this.fluidbook.resize.orientation === 'portrait' || this.fluidbook.singleMode) {
-            numPreloadAfter /= 2;
-            numPreloadBefore /= 2;
+            numPreloadAfter = Math.ceil(numPreloadAfter / 2);
+            numPreloadBefore = Math.ceil(numPreloadBefore / 2);
         }
 
         if (this.fluidbook.shortLoading) {
index 2b04946ad75980ce5053fde63c7bd1f485cf9c8b..9f44e961f7157e36b1edc5c650342d7fb02fa0f6 100644 (file)
@@ -842,7 +842,7 @@ FluidbookSearch.prototype = {
 
         this.closeKeyboardonTouchDevices();
 
-        window.location.hash = '/search/' + q;
+        window.location.hash = '/search/' + encodeURIComponent(q);
 
         this.fluidbook.stats.track(1, this.fluidbook.currentPage, q);