Skip to content

Commit d114f5a

Browse files
committed
fix: fundamentals toc hide-show is now fixed
1 parent 3dc5622 commit d114f5a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/views/collections/framework-field-guide-fundamentals/components/collection-table-of-contents-fundamentals.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ const maxChapterToShow = 10;
5656
<script is:inline>
5757
let shown = false;
5858

59-
const lastChild = document.querySelector("[data-is-last-visible]");
59+
const lastChild = document.querySelector("[data-is-last-visible='true']");
6060

6161
function toggleChapterList() {
62-
const els = [...document.querySelectorAll("[data-should-hide]")];
62+
const els = [...document.querySelectorAll("[data-should-hide='true']")];
6363
if (!shown) {
6464
els.forEach((el) => (el.style.display = "block"));
6565
document.querySelector("#show-button").style.display = "none";
6666
document.querySelector("#hide-button").style.display = "inline-block";
67-
lastChild.removeAttribute("data-is-last-visible");
67+
lastChild.setAttribute("data-is-last-visible", "false");
6868
} else {
6969
els.forEach((el) => (el.style.display = "none"));
7070
document.querySelector("#hide-button").style.display = "none";
7171
document.querySelector("#show-button").style.display = "inline-block";
72-
lastChild.setAttribute("data-is-last-visible", "");
72+
lastChild.setAttribute("data-is-last-visible", "true");
7373
}
7474

7575
shown = !shown;

src/views/collections/framework-field-guide-fundamentals/components/collection-table-of-contents-fundamentals.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
position: relative;
5050
}
5151

52-
.postContainer:not([data-is-last-visible]):not(:last-child)::after {
52+
.postContainer:not([data-is-last-visible="true"]):not(:last-child)::after {
5353
position: absolute;
5454
content: " ";
5555
bottom: 0;
@@ -61,7 +61,7 @@
6161
background: var(--outline);
6262
}
6363

64-
.postContainer[data-should-hide] {
64+
.postContainer[data-should-hide="true"] {
6565
display: none;
6666
}
6767

0 commit comments

Comments
 (0)