Merge "docs: hide the "back to top" link when there's no vertical scroll also use local variables for DOM objects (in a slow effort to eventually remove all non-essential global vars)" into eclair
This commit is contained in:
commit
3556305eb0
1 changed files with 11 additions and 2 deletions
|
@ -220,10 +220,12 @@ function resizePackagesHeight() {
|
|||
/* Resize the height of the side-nav and doc-content divs,
|
||||
* which creates the frame effect */
|
||||
function resizeHeight() {
|
||||
var docContent = $("#doc-content");
|
||||
|
||||
// Get the window height and always resize the doc-content and side-nav divs
|
||||
var windowHeight = ($(window).height() - HEADER_HEIGHT);
|
||||
content.css({height:windowHeight + "px"});
|
||||
sidenav.css({height:windowHeight + "px"});
|
||||
docContent.css({height:windowHeight + "px"});
|
||||
$("#side-nav").css({height:windowHeight + "px"});
|
||||
|
||||
var href = location.href;
|
||||
// If in the reference docs, also resize the "swapper", "classes-nav", and "nav-tree" divs
|
||||
|
@ -239,6 +241,13 @@ function resizeHeight() {
|
|||
} else if (href.indexOf("/resources/") != -1) {
|
||||
$("#devdoc-nav").css({height:sidenav.css("height")});
|
||||
}
|
||||
|
||||
// Hide the "Go to top" link if there's no vertical scroll
|
||||
if ( parseInt($("#jd-content").css("height")) <= parseInt(docContent.css("height")) ) {
|
||||
$("a[href='#top']").css({'display':'none'});
|
||||
} else {
|
||||
$("a[href='#top']").css({'display':'inline'});
|
||||
}
|
||||
}
|
||||
|
||||
/* Resize the width of the "side-nav" and the left margin of the "doc-content" div,
|
||||
|
|
Loading…
Reference in a new issue