Updated dependencies
This commit is contained in:
parent
f0f04b8a6e
commit
6a7a312818
94 changed files with 1683 additions and 1413 deletions
|
@ -14,6 +14,8 @@ displayNavigationFromPage = () => {
|
|||
})
|
||||
}).then(() => {
|
||||
revealNavigationForCurrentPage()
|
||||
}).then(() => {
|
||||
scrollNavigationToSelectedElement()
|
||||
})
|
||||
document.querySelectorAll('.footer a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
|
@ -51,6 +53,31 @@ revealParents = (part) => {
|
|||
}
|
||||
};
|
||||
|
||||
scrollNavigationToSelectedElement = () => {
|
||||
let selectedElement = document.querySelector('div.sideMenuPart[data-active]')
|
||||
if (selectedElement == null) { // nothing selected, probably just the main page opened
|
||||
return
|
||||
}
|
||||
|
||||
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
|
||||
selectedElement.scrollIntoView(true)
|
||||
} else {
|
||||
// if a member within a package is linked, it makes sense to center it since it,
|
||||
// this should make it easier to look at surrounding members
|
||||
selectedElement.scrollIntoView({
|
||||
behavior: 'auto',
|
||||
block: 'center',
|
||||
inline: 'center'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
This is a work-around for safari being IE of our times.
|
||||
It doesn't fire a DOMContentLoaded, presumabely because eventListener is added after it wants to do it
|
||||
|
@ -61,4 +88,4 @@ if (document.readyState == 'loading') {
|
|||
})
|
||||
} else {
|
||||
displayNavigationFromPage()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue