Skip to content

Commit

Permalink
Avoid jumping to WW while scrolling up.
Browse files Browse the repository at this point in the history
Correct the precision of scroll top by taking padding into account.
Fixes https://bugzilla.wikimedia.org/show_bug.cgi?id=39224

Change-Id: I988e9a09018bf2d5c27f11d21947e036c79f56b9
  • Loading branch information
santhoshtr committed Oct 24, 2012
1 parent bebda01 commit c883c3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jquery.uls.lcd.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit c883c3a

Please sign in to comment.