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:
parent
fe04c5b081
commit
37fbf197ea
1 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue