mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
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 <zecakeh@tedomum.fr>
11 lines
298 B
HTML
11 lines
298 B
HTML
{{/*
|
|
|
|
This template is included at the end of each page's `<body>`.
|
|
|
|
We're using it here to highlight and scroll the ToC in the sidebar to match
|
|
the place we are at in the document.
|
|
|
|
*/}}
|
|
|
|
<script defer language="javascript" type="text/javascript" src="{{ "js/toc.js" | relURL }}"></script>
|