Skip to content

Commit a257f95

Browse files
committed
docs: inject sidebar active link scroll into view script
1 parent c4169cb commit a257f95

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

doc/template.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h1>Node.js __VERSION__ documentation</h1>
6464
<span class="picker-arrow"></span>
6565
Options
6666
</a>
67-
67+
6868
<div class="picker" tabindex="-1">
6969
<ul id="options-picker">
7070
<li>
@@ -73,7 +73,7 @@ <h1>Node.js __VERSION__ documentation</h1>
7373
<li>
7474
<a href="__FILENAME__.json">View as JSON</a>
7575
</li>
76-
__EDIT_ON_GITHUB__
76+
__EDIT_ON_GITHUB__
7777
</ul>
7878
</div>
7979
</li>
@@ -90,5 +90,14 @@ <h1>Node.js __VERSION__ documentation</h1>
9090
</div>
9191
</div>
9292
</div>
93+
<script>
94+
const activeLInk = document.querySelector('.interior ul .active');
95+
if (activeLInk) {
96+
activeLInk.scrollIntoView({
97+
behavior: 'smooth',
98+
block: 'center'
99+
});
100+
}
101+
</script>
93102
</body>
94103
</html>

0 commit comments

Comments
 (0)