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;

View File

@@ -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 );