This commit is contained in:
j 2022-09-26 14:35:16 +01:00
parent 2ab7de5687
commit 33be739566

View file

@ -124,6 +124,26 @@ function formatInfo(config, ascroll) {
if (!config.annotations.length && config.body) {
var div = document.createElement('div')
div.innerHTML = config.body
var activate
var part = document.location.hash.slice(1) || 'part1'
div.querySelectorAll("h3.toggle").forEach(title => {
var section = title.nextElementSibling
if (part == title.id && section.style.display == "none") {
activate = title
}
title.onclick = event => {
section.style.display = section.style.display == "none" ? "block" : "none"
div.querySelectorAll("h3.toggle").forEach(other => {
if (other != title) {
var osection = other.nextElementSibling
osection.style.display = "none"
}
})
}
})
if (activate) {
activate.click()
}
ascroll.appendChild(div)
}
return info