diff --git a/src/003-assets/CSS/quicklinks.css b/src/003-assets/CSS/quicklinks.css index 32cab7b039f3ee3277109462058daf074027c889..05a90ade95b41788d25e449bc5ef74b56c53c02c 100644 --- a/src/003-assets/CSS/quicklinks.css +++ b/src/003-assets/CSS/quicklinks.css @@ -50,7 +50,6 @@ div.quick-links div:not(.menu-link):not(.collapsed) + div.menu-link /* give the } /* notification */ - div.quick-links div.notification:not(.category)::after /* notification for entry */, div.quick-links div.category.notification.collapsed > div.toggle::after /* notification for category, disable when uncollapsed */ { diff --git a/src/gui/quicklinks.js b/src/gui/quicklinks.js index 59ea03947d796bf600f8d677340608ddda716a99..c2e487fa1fc6adffbce3b68cf510e1a47187c1ba 100644 --- a/src/gui/quicklinks.js +++ b/src/gui/quicklinks.js @@ -15,6 +15,7 @@ App.UI.quickMenu = (function() { const noHistory = Story.lookup("tags", "no-history").map(passage => passage.title); // if property name is a passage name, then it's a link, otherwise only text. + // category titles are never links to passages // Only two values are allowed: true or an object following the same rules const layout = addOtherCategory({ Main: true, @@ -65,7 +66,7 @@ App.UI.quickMenu = (function() { Tools: { "Find Slave": true, }, - " Options ": { // we trick here so it's handled as pure deco + Options: { Options: true, "Summary Options": true, "Description Options": true, @@ -342,7 +343,7 @@ App.UI.quickMenu = (function() { function generateCategory(name, group) { const toggle = document.createElement("div"); toggle.classList.add("toggle"); - addMenuLink(toggle, name, true); + toggle.append(name); const content = document.createElement("div"); content.classList.add("content"); content.append(generateLinkList(group)); @@ -357,22 +358,15 @@ App.UI.quickMenu = (function() { return wrapper; } - function addMenuLink(container, passage, toggle = false) { + function addMenuLink(container, passage) { // passage is hidden - let hidden = false; if (hiddenPassages.hasOwnProperty(passage) && hiddenPassages[passage]()) { - // only return if the passage is not a category, if it's a category, we handle it like a deco element - if (!toggle) { - return; - } - hidden = true; + return; } // we show some kind of text/link const div = document.createElement("div"); container.append(div); - if (!toggle) { - div.classList.add("menu-link"); - } + div.classList.add("menu-link"); // this passage has a notification if (notifications[passage] && notifications[passage]()) { notificationPassages.push(div); @@ -389,7 +383,7 @@ App.UI.quickMenu = (function() { return; } // That is not a passage we can safely jump to, it's a deco element - if (hidden || !jumpTo.includes(passage)) { + if (!jumpTo.includes(passage)) { div.prepend(uiName(passage)); return; }