-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the JS script to highlight the current ToC entry (#1991)
The code relied on an IntersectionOberver, so the ToC was only updated when a heading was in the viewport. It meant that if we jumped to a part of the text that has no heading, the ToC would still point to the old entry. The new code looks for the correct heading when the view is scrolled so the correct entry is always selected. Signed-off-by: Kévin Commaille <[email protected]>
- Loading branch information
Showing
3 changed files
with
123 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improve the JS script to highlight the current ToC entry. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters