This commit is contained in:
Junyi Hou 2024-03-04 19:44:29 +08:00
parent 0f2fc30529
commit e9269aadb8
2 changed files with 14 additions and 12 deletions

View File

@ -76,7 +76,7 @@ main {
/* Table of Contents */ /* Table of Contents */
.toc { .toc {
/* cursor: zoom-in; */ cursor: zoom-in;
display: block; display: block;
margin-top: 1em; margin-top: 1em;
@ -90,10 +90,10 @@ main {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
} }
/*
.toc.expanded { .toc.expanded {
cursor: zoom-out; cursor: zoom-out;
} */ }
.toc .inner { .toc .inner {
margin: 0px; margin: 0px;

View File

@ -5,15 +5,17 @@
</details> </details>
{{ end }} {{ end }}
<!-- <script> <script>
document.querySelector(".toc").addEventListener("click", function () { document.querySelector(".toc").addEventListener("click", function () {
event.preventDefault(); if (event.target.tagName !== "A") {
if (this.open) { event.preventDefault();
this.open = false; if (this.open) {
this.classList.remove("expanded"); this.open = false;
} else { this.classList.remove("expanded");
this.open = true; } else {
this.classList.add("expanded"); this.open = true;
this.classList.add("expanded");
}
} }
}); });
</script> --> </script>