Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _assets/js/api-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $(function () {
if (!!initialHash) {
setTimeout(function(){
animateScrolling(initialHash);
}, 100);
}, 200);
}

$("#markdown-toc")
Expand Down
15 changes: 14 additions & 1 deletion _assets/js/toc-base.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
function animateScrolling(hash) {
var isApiSection = $("article.api-reference").length == 1;
var breadCrumbsElement = $("p.breadcrumbs");
var hasBreadCrumbs = breadCrumbsElement.length == 1 && breadCrumbsElement.text().trim() != "";
var currentScrollTop = $(window).scrollTop();
var offset = $(hash).offset() || { top: currentScrollTop };
var scrollOffsetCorrection = currentScrollTop == 0 ? HEADER_HEIGHT + NAVBAR_HEIGHT : NAVBAR_HEIGHT;

var scrollOffsetCorrection = NAVBAR_HEIGHT;
if (currentScrollTop == 0) {
scrollOffsetCorrection += HEADER_HEIGHT;
if (hasBreadCrumbs) {
scrollOffsetCorrection += BREADCRUMBS_HEIGHT;
}
if (isApiSection) {
scrollOffsetCorrection += API_SCROLL_FIX;
}
}

$('html, body').animate({
scrollTop: offset.top - scrollOffsetCorrection
Expand Down
2 changes: 1 addition & 1 deletion _assets/js/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $(function() {
if (!!initialHash) {
setTimeout(function(){
animateScrolling(initialHash);
}, 100);
}, 200);
}

// animated scroll
Expand Down
4 changes: 3 additions & 1 deletion _assets/js/top-menu.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var HEADER_HEIGHT = 100;
var HEADER_HEIGHT = 81;
var TELERIKBAR_HEIGHT = 70;
var NAVBAR_HEIGHT = 76;
var BREADCRUMBS_HEIGHT = 20;
var API_SCROLL_FIX = 40;
var SCROLLSPY_OFFSET = TELERIKBAR_HEIGHT + 10; // 10 compensates for the space above the anchored heading
var FOOTER_DISTANCE = 20;
var windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);