Avoid jumping to WW while scrolling up.

Correct the precision of scroll top by taking padding into account.
Fixes https://bugzilla.wikimedia.org/show_bug.cgi?id=39224

Change-Id: I988e9a09018bf2d5c27f11d21947e036c79f56b9
This commit is contained in:
Santhosh Thottingal
2012-10-24 18:18:18 +05:30
parent bebda013d4
commit c883c3a774

View File

@@ -272,9 +272,10 @@
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
var $lcdRegionSection = $( this ),
top = $lcdRegionSection.position().top,
height = $lcdRegionSection.height();
height = $lcdRegionSection.height(),
padding = 10;
if ( top < scrollTop && height > scrollBottom ) {
if ( top - padding <= scrollTop && height > scrollBottom ) {
inviewRegion = $lcdRegionSection.attr( 'id' );
return true;
}