]> _ Git - fluidbook-html5.git/commitdiff
wip #7716 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Sep 2025 15:35:34 +0000 (17:35 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 9 Sep 2025 15:35:34 +0000 (17:35 +0200)
js/libs/fluidbook/fluidbook.elasticslide.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.search.js
style/fluidbook.less

index d33d1cb36b7d2ed23258247cfa1bd8f105e2ef4c..f204bf93d271f37a1e361d29bb3352eff99bf3c3 100644 (file)
@@ -38,6 +38,9 @@ FluidbookElasticSlide.prototype = {
         if ($(p).find('.links').length === 0) {
             p.append('<div class="links" />');
         }
+        if ($(p).find('.searchHighlights').length === 0) {
+            p.append('<div class="searchHighlights" aria-hidden="true" />');
+        }
         return p;
     },
 
index 115d14063bbdd1f92391f27cc4a359336f945699..f5711196481d81f9b25b2743c65af47a96c99e5a 100644 (file)
@@ -378,7 +378,7 @@ FluidbookResize.prototype = {
     },
 
     resizeLinks: function () {
-        $('#links .container, .page .links,.clinks,.ctlinks,#searchHighlights').css({
+        $('#links .container, .page .links,.clinks,.ctlinks,#searchHighlights,.searchHighlights').css({
             transform: 'scale(' + this.bookScale + ')',
         });
     },
index b8c1ca8aac6223c8a753b4c4f094700a553749cd..f83ca257094964e369161a5a022a03b49bc014c6 100644 (file)
@@ -619,7 +619,7 @@ FluidbookSearch.prototype = {
     },
 
     clearHighlights: function () {
-        $("#searchHighlights").html('');
+        $("#searchHighlights,.searchHighlights").html('');
         for (var p in this.plugins) {
             var plugin = this.plugins[p];
             plugin.clearHighlights();
@@ -723,7 +723,11 @@ FluidbookSearch.prototype = {
         }
         $(h).attr('data-hash', hash);
         $(h).css(coords).transform(transform);
-        $("#searchHighlights").append(h);
+        if (this.fluidbook.elasticslide.isActive()) {
+            $(".page.current .searchHighlights").append(h);
+        } else {
+            $("#searchHighlights").append(h);
+        }
     },
 
     initSearchResults: function () {
index 233e9aa2d1db26bec34d8088fb12f7917502ee9c..9bc3dc398325b6ebae8f2eb01eb560906ee21442 100644 (file)
@@ -699,7 +699,7 @@ body, html {
   }
 }
 
-#searchHighlights {
+#searchHighlights, .searchHighlights {
   position: absolute;
   top: 0px;
   left: 0px;