From: Vincent Vanwaelscappel Date: Mon, 12 May 2025 10:44:37 +0000 (+0200) Subject: wip #7461 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e99d78a6521c24fed077fbecf7aa841382c5b699;p=fluidbook-html5.git wip #7461 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.burger.js b/js/libs/fluidbook/fluidbook.burger.js index 03cff21e..4be87c94 100644 --- a/js/libs/fluidbook/fluidbook.burger.js +++ b/js/libs/fluidbook/fluidbook.burger.js @@ -49,7 +49,7 @@ FluidbookBurger.prototype = { // Add close button to menu - this.getElement().append(this.getMenuCloseButton()); + this.getElement().prepend(this.getMenuCloseButton()); this.initBurger(); }, @@ -162,7 +162,8 @@ FluidbookBurger.prototype = { }); // Add search and share links to main menu panel - $('#menuList').append(this.searchHTML + this.shareLinksHTML); + $("#menuList").prepend(this.searchHTML); + $('#menuList').append(this.shareLinksHTML); // Add scrollbar to main menu $('#menuList > ul, #chapterList').perfectScrollbar({ @@ -179,18 +180,27 @@ FluidbookBurger.prototype = { }, open: function () { + let $this = this; this.isOpened = true; $('body').addClass('menu-open'); clearTimeout(this.closeTimeout); $("#menu,#menuOverlay").show(); setTimeout(function () { $("#menu").addClass('open'); + setTimeout(function () { + if ($this.fluidbook.input.isUsingKeyboard()) { + console.log('focus close') + $("#menuClose").get(0).focus(); + } + }, 500); }, 10); $("#main").attr('aria-hidden', 'true'); $("#view").attr('aria-hidden', 'true'); $("#menu").attr('aria-hidden', 'false'); $("#menuOpener").attr('aria-expanded', 'true'); + + }, closeAll: function () { @@ -284,7 +294,7 @@ FluidbookBurger.prototype = { } }); - return '' + getSpriteIcon('interface-close') + ''; + return '' + getSpriteIcon('interface-close') + ''; }, getSearch: function () { @@ -292,8 +302,8 @@ FluidbookBurger.prototype = { var $this = this; var res = '
'; - res += ''; - res += this.nav.getLink('nav-search', '#', 'submitSearch'); + res += ''; + res += ''; res += '
'; res += ''; res += '';