Update dokka docs to v1.16.4_R19
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,31 +1,29 @@
|
||||
window.addEventListener('load', () => {
|
||||
fetch(pathToRoot + "navigation.html")
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
document.getElementById("sideMenu").innerHTML = data;
|
||||
}).then(() => {
|
||||
navigationPageText = fetch(pathToRoot + "navigation.html").then(response => response.text())
|
||||
|
||||
displayNavigationFromPage = () => {
|
||||
navigationPageText.then(data => {
|
||||
document.getElementById("sideMenu").innerHTML = data;
|
||||
}).then(() => {
|
||||
document.querySelectorAll(".overview > a").forEach(link => {
|
||||
link.setAttribute("href", pathToRoot + link.getAttribute("href"));
|
||||
})
|
||||
}).then(() => {
|
||||
document.querySelectorAll(".sideMenuPart").forEach(nav => {
|
||||
if (!nav.classList.contains("hidden")) nav.classList.add("hidden")
|
||||
if (!nav.classList.contains("hidden"))
|
||||
nav.classList.add("hidden")
|
||||
})
|
||||
}).then(() => {
|
||||
revealNavigationForCurrentPage()
|
||||
})
|
||||
|
||||
/* Smooth scrolling support for going to the top of the page */
|
||||
document.querySelectorAll('.footer a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
revealNavigationForCurrentPage = () => {
|
||||
let pageId = document.getElementById("content").attributes["pageIds"].value.toString();
|
||||
@@ -35,9 +33,9 @@ revealNavigationForCurrentPage = () => {
|
||||
parts.forEach(part => {
|
||||
if (part.attributes['pageId'].value.indexOf(pageId) !== -1 && found === 0) {
|
||||
found = 1;
|
||||
if (part.classList.contains("hidden")){
|
||||
part.classList.remove("hidden");
|
||||
part.setAttribute('data-active',"");
|
||||
if (part.classList.contains("hidden")) {
|
||||
part.classList.remove("hidden");
|
||||
part.setAttribute('data-active', "");
|
||||
}
|
||||
revealParents(part)
|
||||
}
|
||||
@@ -45,10 +43,22 @@ revealNavigationForCurrentPage = () => {
|
||||
pageId = pageId.substring(0, pageId.lastIndexOf("/"))
|
||||
} while (pageId.indexOf("/") !== -1 && found === 0)
|
||||
};
|
||||
|
||||
revealParents = (part) => {
|
||||
if (part.classList.contains("sideMenuPart")) {
|
||||
if (part.classList.contains("hidden")) part.classList.remove("hidden");
|
||||
if (part.classList.contains("hidden"))
|
||||
part.classList.remove("hidden");
|
||||
revealParents(part.parentNode)
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
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
|
||||
*/
|
||||
if (document.readyState == 'loading') {
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
displayNavigationFromPage()
|
||||
})
|
||||
} else {
|
||||
displayNavigationFromPage()
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,6 +4,7 @@ filteringContext = {
|
||||
activeFilters: []
|
||||
}
|
||||
let highlightedAnchor;
|
||||
let topNavbarOffset;
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
document.querySelectorAll("div[data-platform-hinted]")
|
||||
@@ -18,6 +19,11 @@ window.addEventListener('load', () => {
|
||||
initTabs()
|
||||
handleAnchor()
|
||||
initHidingLeftNavigation()
|
||||
|
||||
document.getElementById('main').addEventListener("scroll", (e) => {
|
||||
document.getElementsByClassName("navigation-wrapper")[0].classList.toggle("sticky-navigation", e.target.scrollTop > 0)
|
||||
})
|
||||
topNavbarOffset = document.getElementById('navigation-wrapper')
|
||||
})
|
||||
|
||||
const initHidingLeftNavigation = () => {
|
||||
@@ -38,6 +44,27 @@ const initHidingLeftNavigation = () => {
|
||||
// If this is not present user is forced to refresh the site in order to use an anchor
|
||||
window.onhashchange = handleAnchor
|
||||
|
||||
function scrollToElementInContent(element){
|
||||
const scrollToElement = () => document.getElementById('main').scrollTo({ top: element.offsetTop - topNavbarOffset.offsetHeight, behavior: "smooth"})
|
||||
|
||||
const waitAndScroll = () => {
|
||||
setTimeout(() => {
|
||||
if(topNavbarOffset){
|
||||
scrollToElement()
|
||||
} else {
|
||||
waitForScroll()
|
||||
}
|
||||
}, 50)
|
||||
}
|
||||
|
||||
if(topNavbarOffset){
|
||||
scrollToElement()
|
||||
} else {
|
||||
waitAndScroll()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function handleAnchor() {
|
||||
if(highlightedAnchor){
|
||||
highlightedAnchor.classList.remove('anchor-highlight')
|
||||
@@ -64,7 +91,8 @@ function handleAnchor() {
|
||||
content.classList.add('anchor-highlight')
|
||||
highlightedAnchor = content
|
||||
}
|
||||
element.scrollIntoView({behavior: "smooth"})
|
||||
|
||||
scrollToElementInContent(element)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,4 +288,3 @@ function refreshFilterButtons() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user