From: Vincent Vanwaelscappel Date: Fri, 9 May 2025 16:28:34 +0000 (+0200) Subject: #7461 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7ad5daa0dcf907da5a749a1423ddfa0730e899a4;p=fluidbook-html5.git #7461 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.burger.js b/js/libs/fluidbook/fluidbook.burger.js index 18de4036..251e77c7 100644 --- a/js/libs/fluidbook/fluidbook.burger.js +++ b/js/libs/fluidbook/fluidbook.burger.js @@ -215,6 +215,14 @@ FluidbookBurger.prototype = { return this.open(); }, + hideMenuItems: function () { + gsap.to($('#menuList > li, #shareLinks,footer#mobile-credits'), {duration: 0.1, autoAlpha: 0}); + }, + + showMenuItems: function () { + gsap.to($('#menuList > li, #shareLinks,footer#mobile-credits'), {duration: 0.3, autoAlpha: 1}); + }, + openSearch: function (q, cb) { if (!this.fluidbook.search.isSearchActive()) { if (!this.fluidbook.settings.searchFullBurger) { @@ -223,7 +231,6 @@ FluidbookBurger.prototype = { } } - if (q !== undefined) { $("#q").val(q); if ($("#menuSearchResults .content").length === 0) { diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 409a9158..c1a1b624 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -833,14 +833,6 @@ Fluidbook.prototype = { return i + 1; }, - hideMenuItems: function () { - gsap.to($('#menuList > ul > li, #shareLinks,footer#mobile-credits'), {duration: 0.1, autoAlpha: 0}); - }, - - showMenuItems: function () { - gsap.to($('#menuList > ul > li, #shareLinks,footer#mobile-credits'), {duration: 0.3, autoAlpha: 1}); - }, - print: function (button) { return this.openPDF(button, true); }, diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 4e6d6549..dfcc9fc2 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -700,6 +700,10 @@ FluidbookNav.prototype = { burgerActive: function () { return this.burger.isActive(); - } + }, + + openSearch: function () { + return this.burger.openSearch(); + }, }; diff --git a/js/libs/fluidbook/fluidbook.search.js b/js/libs/fluidbook/fluidbook.search.js index f8216f08..3c6110ff 100644 --- a/js/libs/fluidbook/fluidbook.search.js +++ b/js/libs/fluidbook/fluidbook.search.js @@ -731,18 +731,14 @@ FluidbookSearch.prototype = { return; } this.menuSearchHints = $('#menuSearchHints'); - this.fluidbook.hideMenuItems(); // Hide menu items to give space for hints div + this.fluidbook.nav.burger.hideMenuItems(); // Hide menu items to give space for hints div this.menuSearchHints.fadeIn(300); - - // if (this.menuSearchHints.hasClass('mm-hidden')) { - // this.nav.menuAPI.openPanel(this.menuSearchHints, false); - // } }, getSearchHints: function (q) { if (!this.hintsEnabled) { - this.fluidbook.hideMenuItems(); + this.fluidbook.nav.burger.hideMenuItems(); this._loadLib(function () { }); @@ -827,7 +823,7 @@ FluidbookSearch.prototype = { this.hideSearchHints(); this.hideSearchResults(); - this.fluidbook.showMenuItems(); // Show menu items that were hidden previously + this.fluidbook.nav.burger.showMenuItems(); // Show menu items that were hidden previously }, submitForm: function () { diff --git a/js/main.js b/js/main.js index b738c0b9..7dda1d0d 100644 --- a/js/main.js +++ b/js/main.js @@ -490,7 +490,7 @@ function searchHints() { if ($("#q").val().length == 0) { fluidbook.search.hideSearchHints(); fluidbook.search.hideSearchResults(); - fluidbook.showMenuItems(); // Show main menu items that were hidden previously + fluidbook.nav.burger.showMenuItems(); // Show main menu items that were hidden previously } } catch (err) { }