File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 11function animateScrolling ( hash ) {
2+ var isApiSection = $ ( "article.api-reference" ) . length == 1 ;
3+ var hasBreadCrumbs = $ ( "p.breadcrumbs" ) . length == 1 && $ ( "p.breadcrumbs" ) . text ( ) . trim ( ) != "" ;
24 var currentScrollTop = $ ( window ) . scrollTop ( ) ;
35 var offset = $ ( hash ) . offset ( ) || { top : currentScrollTop } ;
4- var scrollOffsetCorrection = currentScrollTop == 0 ? HEADER_HEIGHT + NAVBAR_HEIGHT : NAVBAR_HEIGHT ;
6+
7+ var scrollOffsetCorrection = NAVBAR_HEIGHT ;
8+ if ( currentScrollTop == 0 ) {
9+ scrollOffsetCorrection += HEADER_HEIGHT ;
10+ if ( hasBreadCrumbs ) {
11+ scrollOffsetCorrection += BREADCRUMBS_HEIGHT ;
12+ }
13+ if ( isApiSection ) {
14+ scrollOffsetCorrection += API_SCROLL_FIX ;
15+ }
16+ }
517
618 $ ( 'html, body' ) . animate ( {
719 scrollTop : offset . top - scrollOffsetCorrection
Original file line number Diff line number Diff line change 11var 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