Skip to content

Commit

Permalink
fix for scroll-padding without toc
Browse files Browse the repository at this point in the history
  • Loading branch information
thaider committed Jul 24, 2023
1 parent 607b569 commit 80a0f90
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions public/default/css/tweeki.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/default/js/tweeki.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/default/js/tweeki.js.LICENSE.txt
@@ -1,6 +1,6 @@
/*!
* Bootstrap v4.6.2 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Bootstrap v4.6.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

Expand Down
8 changes: 4 additions & 4 deletions resources/scripts/tweeki/tweeki.js
Expand Up @@ -58,6 +58,10 @@ jQuery(document).ready(function ($) {
/**
* TOC
*/
// set scroll-padding according to the content's offset
var offset = $('#contentwrapper').css('padding-top');
$('html, body').css('scroll-padding-top', offset);

// move TOC elsewhere
if( $( "#tweekiTOC" ).length == 1 && $( "#toc" ).length == 1 ) {
// toc copies
Expand Down Expand Up @@ -91,13 +95,9 @@ jQuery(document).ready(function ($) {
$('#toc ul a')
.addClass('nav-link')

var offset = $('#contentwrapper').css('padding-top');
console.log( offset );
$('html, body').css('scroll-padding-top', offset);
$('body')
.scrollspy({target: '#toc ul', offset: parseInt( offset ) + 10});
}

}


Expand Down

0 comments on commit 80a0f90

Please sign in to comment.