File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed
Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ $(function () {
1313 if ( ! ! initialHash ) {
1414 setTimeout ( function ( ) {
1515 animateScrolling ( initialHash ) ;
16- } , 100 ) ;
16+ } , 200 ) ;
1717 }
1818
1919 $ ( "#markdown-toc" )
Original file line number Diff line number Diff line change 11function animateScrolling ( hash ) {
2+ var isApiSection = $ ( "article.api-reference" ) . length == 1 ;
3+ var breadCrumbsElement = $ ( "p.breadcrumbs" ) ;
4+ var hasBreadCrumbs = breadCrumbsElement . length == 1 && breadCrumbsElement . text ( ) . trim ( ) != "" ;
25 var currentScrollTop = $ ( window ) . scrollTop ( ) ;
36 var offset = $ ( hash ) . offset ( ) || { top : currentScrollTop } ;
4- var scrollOffsetCorrection = currentScrollTop == 0 ? HEADER_HEIGHT + NAVBAR_HEIGHT : NAVBAR_HEIGHT ;
7+
8+ var scrollOffsetCorrection = NAVBAR_HEIGHT ;
9+ if ( currentScrollTop == 0 ) {
10+ scrollOffsetCorrection += HEADER_HEIGHT ;
11+ if ( hasBreadCrumbs ) {
12+ scrollOffsetCorrection += BREADCRUMBS_HEIGHT ;
13+ }
14+ if ( isApiSection ) {
15+ scrollOffsetCorrection += API_SCROLL_FIX ;
16+ }
17+ }
518
619 $ ( 'html, body' ) . animate ( {
720 scrollTop : offset . top - scrollOffsetCorrection
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ $(function() {
5858 if ( ! ! initialHash ) {
5959 setTimeout ( function ( ) {
6060 animateScrolling ( initialHash ) ;
61- } , 100 ) ;
61+ } , 200 ) ;
6262 }
6363
6464 // animated scroll
Original file line number Diff line number Diff line change 1- var HEADER_HEIGHT = 100 ;
1+ var HEADER_HEIGHT = 81 ;
22var TELERIKBAR_HEIGHT = 70 ;
33var NAVBAR_HEIGHT = 76 ;
4+ var BREADCRUMBS_HEIGHT = 20 ;
5+ var API_SCROLL_FIX = 40 ;
46var SCROLLSPY_OFFSET = TELERIKBAR_HEIGHT + 10 ; // 10 compensates for the space above the anchored heading
57var FOOTER_DISTANCE = 20 ;
68var windowHeight = Math . max ( document . documentElement . clientHeight , window . innerHeight || 0 ) ;
You can’t perform that action at this time.
0 commit comments