aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/static/js/content/page.js
blob: 366a033ca03e74cf297310c8ce6266e2c9e87b18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
document.addEventListener("DOMContentLoaded", () => {
    const headers = document.getElementsByClassName("collapsible");
    for (const header of headers) {
        header.addEventListener("click", () => {
            var content = header.nextElementSibling;
            if (content.style.maxHeight){
              content.style.maxHeight = null;
            } else {
              content.style.maxHeight = content.scrollHeight + "px";
            }
        });
    }
});