Skip to content

Commit 13615ec

Browse files
committed
change so that when you select an item on right side bar, it gets highlighted as the actively selected item.
1 parent e5a6c76 commit 13615ec

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

site_jaspr/lib/components/site_footer.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ class SiteFooter extends StatelessComponent {
4141
/// Inline script that highlights the active TOC link based on scroll position.
4242
static const _tocScrollspy = '''
4343
(function(){
44-
var links = document.querySelectorAll('.toc a');
45-
if (!links.length) return;
46-
var ids = [];
47-
links.forEach(function(a) {
48-
var h = a.getAttribute('href');
49-
if (h) { var id = h.split('#')[1]; if (id) ids.push({id:id, el:a}); }
50-
});
51-
if (!ids.length) return;
5244
function update() {
45+
var links = document.querySelectorAll('.toc a');
46+
if (!links.length) return;
47+
var ids = [];
48+
links.forEach(function(a) {
49+
var h = a.getAttribute('href');
50+
if (h) { var id = h.split('#')[1]; if (id) ids.push({id:id, el:a}); }
51+
});
52+
if (!ids.length) return;
5353
var active = null;
5454
for (var i = 0; i < ids.length; i++) {
5555
var t = document.getElementById(ids[i].id);

0 commit comments

Comments
 (0)