From 54d1b0afb9c57c52fed9ab6f57c86e0fcfd0b4c7 Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Mon, 19 Jun 2017 18:31:49 +0200 Subject: [PATCH] Handle cascading and non-cascading chapter views in the menu. Remove links from parent items when in cascade mode. Debug problems with MMenu v6.x. WIP #807 @3 --- js/libs/fluidbook/fluidbook.nav.js | 32 ++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 2c448c7d..1f67d803 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -279,11 +279,39 @@ FluidbookNav.prototype = { } this.setInterface(); + // Insert Chapters submenus if (this.chaptersMenuHTML != '') { $('#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