From b4d40ef81c66f96378c23898b40b4b66d6292976 Mon Sep 17 00:00:00 2001 From: soufiane Date: Wed, 11 Feb 2026 10:39:33 +0100 Subject: [PATCH] wait #7998 @1:00 --- js/libs/fluidbook/fluidbook.burger.js | 9 +++++++-- js/libs/fluidbook/fluidbook.search.js | 13 ++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.burger.js b/js/libs/fluidbook/fluidbook.burger.js index 1388d320..1008e4f4 100644 --- a/js/libs/fluidbook/fluidbook.burger.js +++ b/js/libs/fluidbook/fluidbook.burger.js @@ -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; }) diff --git a/js/libs/fluidbook/fluidbook.search.js b/js/libs/fluidbook/fluidbook.search.js index 07212bf7..af8ada54 100644 --- a/js/libs/fluidbook/fluidbook.search.js +++ b/js/libs/fluidbook/fluidbook.search.js @@ -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); -- 2.39.5