am 97654bc6: am db3da9bb: am c9cea375: am 707909f2: 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 wi

* commit '97654bc68fe98ec443599b46fa0ad2c518fa4875':
  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.
This commit is contained in:
Scott Main 2012-12-19 19:32:13 -08:00 committed by Android Git Automerger
commit f9b6e097cb
1 changed files with 6 additions and 0 deletions

View File

@ -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