aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Main <smain@google.com>2012-12-19 19:23:32 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-12-19 19:23:32 -0800
commit707909f2e0fb9ccc0db859ec075a3557f5265e56 (patch)
tree8bc08a3c680c5e8f7b9da907c10641a7f7886350
parent6a6c11215bdf3f114ed3589ede4bda006adacf7e (diff)
parentb8d06a55e0fbe02c9ef31f4ccef2571e74c371d7 (diff)
downloadbuild-707909f2e0fb9ccc0db859ec075a3557f5265e56.tar.gz
Merge "docs: don't allow setting the sidenav fixed if the doc body is shorter than the sidenav. Scrolling won't be possible in this case anyway, but this change fixes a glitch that happens on OSX Lion because it will allow scrolling anyway for the overscroll bounce." into jb-mr1-dev
-rw-r--r--tools/droiddoc/templates-sdk/assets/js/docs.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index b5f8946117..d6032691fa 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -358,7 +358,13 @@ false; // navigate across topic boundaries only in design docs
var searchResultHeight = $('#searchResults').is(":visible") ?
$('#searchResults').outerHeight() : 0;
var totalHeaderHeight = headerHeight + subheaderHeight + searchResultHeight;
+ // we set the navbar fixed when the scroll position is beyond the height of the site header...
var navBarShouldBeFixed = scrollTop > totalHeaderHeight;
+ // ... except if the document content is shorter than the sidenav height.
+ // (this is necessary to avoid crazy behavior on OSX Lion due to overscroll bouncing)
+ if ($("#doc-col").height() < $("#side-nav").height()) {
+ navBarShouldBeFixed = false;
+ }
var scrollLeft = $(window).scrollLeft();
// When the sidenav is fixed and user scrolls horizontally, reposition the sidenav to match