Skip to content

Commit a5bbea3

Browse files
author
Jani Giannoudis
committed
toggle for inheritance members
1 parent c729509 commit a5bbea3

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

docfx/templates/darkerfx/styles/toggle-theme.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
// Collapse inherited members section
2+
document.addEventListener("DOMContentLoaded", function () {
3+
document.querySelectorAll("h3, h2").forEach(function (heading) {
4+
if (heading.textContent.trim() === "Inherited Members") {
5+
var list = heading.nextElementSibling;
6+
if (!list) return;
7+
8+
heading.style.cursor = "pointer";
9+
heading.style.userSelect = "none";
10+
11+
var indicator = document.createElement("span");
12+
indicator.className = "inherited-toggle";
13+
indicator.textContent = " ▶";
14+
heading.appendChild(indicator);
15+
16+
list.style.display = "none";
17+
18+
heading.addEventListener("click", function () {
19+
var collapsed = list.style.display === "none";
20+
list.style.display = collapsed ? "" : "none";
21+
indicator.textContent = collapsed ? " ▼" : " ▶";
22+
});
23+
}
24+
});
25+
});
26+
127
const sw = document.getElementById("switch-style"), b = document.body;
228

329
if (sw && b) {

0 commit comments

Comments
 (0)