1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-06 22:15:23 +02:00

Update table-of-content.js

This commit is contained in:
Taly 2022-07-13 18:38:18 +03:00
parent fe04c5b081
commit 37fbf197ea

View file

@ -253,6 +253,11 @@ export default class TableOfContent {
* If targetLink is not defined then do nothing
*/
if (!targetLink) {
/**
* Show the top of table of content
*/
document.querySelector(`.${this.CSS.tocHeader}`).scrollIntoViewIfNeeded();
return;
}
@ -278,6 +283,7 @@ export default class TableOfContent {
*/
if (listItem) {
listItem.classList.add(this.CSS.tocElementItemActive);
listItem.scrollIntoViewIfNeeded();
}
}
}