]> _ Git - fluidbook-html5.git/commitdiff
wait #7998 @1:00
authorsoufiane <soufiane@cubedesigners.com>
Wed, 11 Feb 2026 09:39:33 +0000 (10:39 +0100)
committersoufiane <soufiane@cubedesigners.com>
Wed, 11 Feb 2026 09:39:33 +0000 (10:39 +0100)
js/libs/fluidbook/fluidbook.burger.js
js/libs/fluidbook/fluidbook.search.js

index 1388d320efb0d36e0376a6234e16ba85335a3e8d..1008e4f440a08edecc4d497d2d8a605b8e01383b 100644 (file)
@@ -310,7 +310,7 @@ FluidbookBurger.prototype = {
         })
 
         // Search form handler
-        $(document).on('submit', '#searchForm', function () {
+        $(document).on('submit', '#menuSearch #searchForm', function (e) {
             $this.fluidbook.search.submitForm();
             return false;
         });
@@ -353,7 +353,12 @@ FluidbookBurger.prototype = {
             e.pop();
             e.push($(this).attr('term'));
             $("#q").val(e.join(' '));
-            $("#searchForm").submit();
+            if($this.fluidbook.search.isSearchfloatActive) {
+                var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb').attr('page'));
+                $this.fluidbook.search.openResultsNav(pageNumber);
+            } else {
+                $("#searchForm").submit();
+            }
             return false;
         })
 
index 07212bf7abe6ffda979ab1ec3e328fdc4713ef1d..af8ada54275c583eccf4beeb99f6ec7f0095334e 100644 (file)
@@ -89,12 +89,6 @@ FluidbookSearch.prototype = {
         this.resultsNav = $('#' + this.resultsNavID);
 
         //=== Event handlers
-        $(document).on(this.fluidbook.input.clickEvent, 'body.floatmode #menuSearchHints a', function () {
-            // Find the page number of the result so we can see where it sits in the list of returned results
-            var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb').attr('page'));
-            $this.openResultsNav(pageNumber);
-        });
-
         $(document).on(this.fluidbook.input.clickEvent, '#menuSearchResults a', function () {
             // Find the page number of the result so we can see where it sits in the list of returned results
             var pageNumber = parseInt($(this).find('.doubleThumb').attr('page'));
@@ -123,7 +117,7 @@ FluidbookSearch.prototype = {
         });
 
         $(this.fluidbook).on('fluidbook.resize.orientation', function (event, details) {
-            if (!$this.resultsNavActive()) {
+            if (!$this.resultsNavActive() || $this.isSearchfloatActive) {
                 return;
             }
             $this.updateResultsNav($this.fluidbook.currentPage);
@@ -1104,8 +1098,9 @@ FluidbookSearch.prototype = {
         // Redirect to the only result page if the flag is enabled
         if(this.fluidbook.search.isSearchfloatActive && $this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').length > 0) {
             setTimeout(function () {
-                fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"][data-pages*='+referencePage+']').attr('page'));
-                var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb[data-enabled="1"][data-pages*='+referencePage+']').attr('page'));
+                fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"][data-pages*='+parseInt(referencePage)+']').attr('page'));
+                var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb[data-enabled="1"][data-pages*='+parseInt(referencePage)+']').attr('page'));
+                console.log(pageNumber)
                 $this.openResultsNav(pageNumber);
                 fluidbook.nav.burger.close();
             }, 100);