Skip to content

Commit

Permalink
Fix scrollspy offset
Browse files Browse the repository at this point in the history
  • Loading branch information
malberts committed Aug 2, 2024
1 parent df85d56 commit 9abc783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions resources/js/Components/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
}

function enableScrollspy() {
// Default offset is one navbar plus extra.
var offset = parseFloat( $( '.chameleon-toc-wrapper' ).css( '--scrollspy-offset' ) || 80 );
var offset = parseFloat( $( '.chameleon-toc-wrapper' ).css( '--scrollspy-offset' ) );

// TODO: re-test when using Sticky Modification.
// var stickyNavbar = $( '.p-navbar[style*="position"]' );
Expand Down
3 changes: 3 additions & 0 deletions resources/styles/Components/Toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

max-height: 100vh;
overflow: auto;

// Default offset is one navbar plus extra.
--scrollspy-offset: 80;
}

.chameleon-toc {
Expand Down

0 comments on commit 9abc783

Please sign in to comment.