gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
docs/config/doxygen-awesome-theme/doxygen-awesome-tabs.js
1 // SPDX-License-Identifier: MIT
2 /**
3
4 Doxygen Awesome
5 https://github.com/jothepro/doxygen-awesome-css
6
7 Copyright (c) 2023 - 2025 jothepro
8
9 */
10
11 class DoxygenAwesomeTabs {
12
13 static init() {
14 window.addEventListener("load", () => {
15 document.querySelectorAll(".tabbed:not(:empty)").forEach((tabbed, tabbedIndex) => {
16 let tabLinkList = []
17 tabbed.querySelectorAll(":scope > ul > li").forEach((tab, tabIndex) => {
18 tab.id = "tab_" + tabbedIndex + "_" + tabIndex
19 let header = tab.querySelector(".tab-title")
20 let tabLink = document.createElement("button")
21 tabLink.classList.add("tab-button")
22 tabLink.appendChild(header)
23 header.title = header.textContent
24 tabLink.addEventListener("click", () => {
25 tabbed.querySelectorAll(":scope > ul > li").forEach((tab) => {
26 tab.classList.remove("selected")
27 })
28 tabLinkList.forEach((tabLink) => {
29 tabLink.classList.remove("active")
30 })
31 tab.classList.add("selected")
32 tabLink.classList.add("active")
33 })
34 tabLinkList.push(tabLink)
35 if(tabIndex == 0) {
36 tab.classList.add("selected")
37 tabLink.classList.add("active")
38 }
39 })
40 let tabsOverview = document.createElement("div")
41 tabsOverview.classList.add("tabs-overview")
42 let tabsOverviewContainer = document.createElement("div")
43 tabsOverviewContainer.classList.add("tabs-overview-container")
44 tabLinkList.forEach((tabLink) => {
45 tabsOverview.appendChild(tabLink)
46 })
47 tabsOverviewContainer.appendChild(tabsOverview)
48 tabbed.before(tabsOverviewContainer)
49
50 function resize() {
51 let maxTabHeight = 0
52 tabbed.querySelectorAll(":scope > ul > li").forEach((tab, tabIndex) => {
53 let visibility = tab.style.display
54 tab.style.display = "block"
55 maxTabHeight = Math.max(tab.offsetHeight, maxTabHeight)
56 tab.style.display = visibility
57 })
58 tabbed.style.height = `${maxTabHeight + 10}px`
59 }
60
61 resize()
62 new ResizeObserver(resize).observe(tabbed)
63 })
64 })
65
66 }
67
68 static resize(tabbed) {
69
70 }
71 }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.