Update jquery.uls from upstream
* Improve the scroll to viewport feature * Fixes Bug 49447 Bug: 49447 Change-Id: Ided6ffdc431ad7278acd501a91cef4a472df1b6f
This commit is contained in:
committed by
Siebrand
parent
7b92820129
commit
ddd425eb9b
@@ -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;
|
||||
|
||||
@@ -178,7 +178,8 @@
|
||||
$.each( $.uls.data.regiongroups, function ( regionCode ) {
|
||||
$section = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', regionCode );
|
||||
|
||||
$sectionTitle = $( '<h3 data-i18n="uls-region-' + regionCode + '">' )
|
||||
$sectionTitle = $( '<h3>' )
|
||||
.attr( 'data-i18n', 'uls-region-' + regionCode )
|
||||
.addClass( 'eleven columns uls-lcd-region-section uls-lcd-region-title offset-by-one' )
|
||||
.text( regions[regionCode] );
|
||||
|
||||
@@ -214,7 +215,8 @@
|
||||
quickList.sort( $.uls.data.sortByAutonym );
|
||||
|
||||
$quickListSection = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', 'uls-lcd-quicklist' );
|
||||
$quickListSectionTitle = $( '<h3 data-i18n="uls-common-languages">' )
|
||||
$quickListSectionTitle = $( '<h3>' )
|
||||
.attr( 'data-i18n', 'uls-common-languages' )
|
||||
.addClass( 'eleven columns uls-lcd-region-section uls-lcd-region-title offset-by-one' )
|
||||
.text( 'Common languages' ); // This is placeholder text if jquery.i18n not present
|
||||
$quickListSection.append( $quickListSectionTitle );
|
||||
|
||||
Reference in New Issue
Block a user