From 706781820ba2e263224e4fbd01451a66689f1c33 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 9 May 2025 12:38:19 +0200 Subject: [PATCH] wip #7461 @0:40 --- js/libs/fluidbook/fluidbook.burger.js | 320 +++++++++++++++++++++++++- js/libs/fluidbook/fluidbook.help.js | 29 ++- js/libs/fluidbook/fluidbook.nav.js | 308 ++----------------------- 3 files changed, 353 insertions(+), 304 deletions(-) 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