File tree Expand file tree Collapse file tree
site_jaspr/lib/components Expand file tree Collapse file tree Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments