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:
@@ -272,9 +272,10 @@
|
|||||||
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
|
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
|
||||||
var $lcdRegionSection = $( this ),
|
var $lcdRegionSection = $( this ),
|
||||||
top = $lcdRegionSection.position().top,
|
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' );
|
inviewRegion = $lcdRegionSection.attr( 'id' );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user