From: Vincent Vanwaelscappel Date: Fri, 9 May 2025 10:38:19 +0000 (+0200) Subject: wip #7461 @0:40 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=706781820ba2e263224e4fbd01451a66689f1c33;p=fluidbook-html5.git wip #7461 @0:40 --- diff --git a/js/libs/fluidbook/fluidbook.burger.js b/js/libs/fluidbook/fluidbook.burger.js index 1cec0ab9..4a85d2a2 100644 --- a/js/libs/fluidbook/fluidbook.burger.js +++ b/js/libs/fluidbook/fluidbook.burger.js @@ -1,10 +1,324 @@ -function FluidbookBurger(fluidbook) { - this.fluidbook = fluidbook; - this.init(); +function FluidbookBurger(nav) { + this.nav = nav; + this.fluidbook = nav.fluidbook; + this.closeTimeout; } FluidbookBurger.prototype = { + init: function () { + // Copy credits + var credits = $("footer#credits").clone().attr('id', 'mobile-credits'); + var a = credits.find('a'); + var t = a.text(); + credits.find('a').text(t); + $("#menuList").append(credits); + + // Insert Chapters submenus + if (this.chaptersMenuHTML !== '') { + $('#menu_chapters').parent().append(this.chaptersMenuHTML); + } + + // Remove unwanted links from chapters menu + // For any items that have a submenu, we want to remove the page link + // from the parent item to make it easier to open the submenu + $('#chapterList li a').each(function () { // Process all links in the chapters submenu + if ($(this).siblings('ul').length > 0) { // Check if any have a