Update jquery.uls from upstream

* Improve the scroll to viewport feature
* Fixes Bug 49447

Bug: 49447
Change-Id: Ided6ffdc431ad7278acd501a91cef4a472df1b6f
This commit is contained in:
Santhosh Thottingal
2013-06-12 09:23:31 +05:30
committed by Siebrand
parent 7b92820129
commit ddd425eb9b
2 changed files with 8 additions and 6 deletions

View File

@@ -432,15 +432,15 @@
var scrollPosition,
$window = $( window ),
windowHeight = $window.height(),
windowScrollTop = $window.scrollTop(),
windowBottom = windowScrollTop + windowHeight,
windowTop = $window.scrollTop(),
windowBottom = windowTop + windowHeight,
$element = $( this ),
panelHeight = $element.height(),
panelTop = $element.offset().top,
panelBottom = panelTop + panelHeight;
if ( ( panelTop < windowScrollTop ) || ( panelBottom > windowBottom ) ) {
if ( panelHeight > windowHeight ) {
if ( ( panelTop < windowTop ) || ( panelBottom > windowBottom ) ) {
if ( windowTop > panelTop ) {
scrollPosition = panelTop;
} else {
scrollPosition = panelBottom - windowHeight;