mirror of
https://git.sr.ht/~ashkeel/strimertul-website
synced 2024-11-23 21:32:20 +00:00
fix toc glitch
This commit is contained in:
parent
a0fc21db39
commit
1654191f87
1 changed files with 3 additions and 1 deletions
|
@ -18,7 +18,9 @@ if (toc) {
|
||||||
(i) => getId(i.target) && i.intersectionRatio > 0
|
(i) => getId(i.target) && i.intersectionRatio > 0
|
||||||
);
|
);
|
||||||
if (filtered.length > 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) => {
|
filtered.forEach((entry) => {
|
||||||
const id = getId(entry.target);
|
const id = getId(entry.target);
|
||||||
toc
|
toc
|
||||||
|
|
Loading…
Reference in a new issue