From 7a875ee7d20b67725debd4c2c9e1f93e1889c302 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 29 Jul 2022 14:32:24 +0200 Subject: Add member icons to navigation menu (#2578) --- plugins/base/src/main/resources/dokka/scripts/navigation-loader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/base/src/main/resources/dokka/scripts/navigation-loader.js') diff --git a/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js b/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js index 9c824b91..92464911 100644 --- a/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js +++ b/plugins/base/src/main/resources/dokka/scripts/navigation-loader.js @@ -59,7 +59,10 @@ scrollNavigationToSelectedElement = () => { return } - let isPackageElement = selectedElement.children.length > 1 + let hasIcon = selectedElement.querySelectorAll(":scope > div.overview span.nav-icon").length > 0 + + // for instance enums also have children and are expandable, but are not package/module elements + let isPackageElement = selectedElement.children.length > 1 && !hasIcon if (isPackageElement) { // if package is selected or linked, it makes sense to align it to top // so that you can see all the members it contains -- cgit