1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul-website synced 2024-12-21 23:12:19 +00:00

fix toc glitch

This commit is contained in:
Ash Keel 2023-03-01 14:21:07 +01:00
parent a0fc21db39
commit 1654191f87
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E

View file

@ -18,7 +18,9 @@ if (toc) {
(i) => getId(i.target) && i.intersectionRatio > 0
);
if (filtered.length > 0) {
toc.querySelector(`li.active`)?.classList.remove("active");
toc
.querySelectorAll(`li.active`)
.forEach((entry) => entry.classList.remove("active"));
filtered.forEach((entry) => {
const id = getId(entry.target);
toc