Skip to content

Commit bf8ef4c

Browse files
committed
Ensure that existing onscroll handler is still called.
1 parent 6879289 commit bf8ef4c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

markdown/index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,14 @@ <h2>Table of Contents</h2>
486486
}
487487
}
488488

489-
window.onscroll = updateTocSize;
489+
490+
const onscroll = window.onscroll;
491+
window.onscroll = function (event) {
492+
if (onscroll != null) {
493+
onscroll(event);
494+
}
495+
updateTocSize();
496+
};
490497
window.onresize = updateTocSize;
491498

492499
//]]>

0 commit comments

Comments
 (0)