diff options
author | Scott Main <smain@google.com> | 2010-01-12 13:37:00 -0800 |
---|---|---|
committer | Scott Main <smain@google.com> | 2010-01-13 08:22:27 -0800 |
commit | 13b79b2eb1d1dfefc2e2697f1840177561694841 (patch) | |
tree | 64f8df47a4b465466d91a7d93e0c222c6454db10 | |
parent | 7e680c89ae01ca30c411f32e2e7ca1c093db0336 (diff) | |
download | build-13b79b2eb1d1dfefc2e2697f1840177561694841.tar.gz |
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)
-rw-r--r-- | tools/droiddoc/templates/assets/android-developer-docs.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/droiddoc/templates/assets/android-developer-docs.js b/tools/droiddoc/templates/assets/android-developer-docs.js index fa24e995c9..1099e6e040 100644 --- a/tools/droiddoc/templates/assets/android-developer-docs.js +++ b/tools/droiddoc/templates/assets/android-developer-docs.js @@ -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, |