diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2022-07-29 14:32:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 14:32:24 +0200 |
commit | 7a875ee7d20b67725debd4c2c9e1f93e1889c302 (patch) | |
tree | 075210f83e5e5a7679194ba8c88dc426dead0777 /plugins/base/src/main/resources/dokka/scripts/navigation-loader.js | |
parent | 26dde5b201b3c7e66212b07ddef333a3e340022a (diff) | |
download | dokka-7a875ee7d20b67725debd4c2c9e1f93e1889c302.tar.gz dokka-7a875ee7d20b67725debd4c2c9e1f93e1889c302.tar.bz2 dokka-7a875ee7d20b67725debd4c2c9e1f93e1889c302.zip |
Add member icons to navigation menu (#2578)
Diffstat (limited to 'plugins/base/src/main/resources/dokka/scripts/navigation-loader.js')
-rw-r--r-- | plugins/base/src/main/resources/dokka/scripts/navigation-loader.js | 5 |
1 files changed, 4 insertions, 1 deletions
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 |