add back removed left sidebar scroll behavior

This commit is contained in:
Fred K. Schott 2021-07-19 21:30:30 -07:00
parent 50f82e1a53
commit 7ad7e16633

View file

@ -21,6 +21,15 @@ const {currentPage} = Astro.props;
</ul>
</nav>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
var target = document.querySelector('.nav-link.is-active');
if (target && (target.offsetTop > (window.innerHeight - 100))) {
document.querySelector('.nav-groups').scrollTop = target.offsetTop;
}
});
</script>
<style>
nav {
width: 100%;