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, var scrollPosition,
$window = $( window ), $window = $( window ),
windowHeight = $window.height(), windowHeight = $window.height(),
windowScrollTop = $window.scrollTop(), windowTop = $window.scrollTop(),
windowBottom = windowScrollTop + windowHeight, windowBottom = windowTop + windowHeight,
$element = $( this ), $element = $( this ),
panelHeight = $element.height(), panelHeight = $element.height(),
panelTop = $element.offset().top, panelTop = $element.offset().top,
panelBottom = panelTop + panelHeight; panelBottom = panelTop + panelHeight;
if ( ( panelTop < windowScrollTop ) || ( panelBottom > windowBottom ) ) { if ( ( panelTop < windowTop ) || ( panelBottom > windowBottom ) ) {
if ( panelHeight > windowHeight ) { if ( windowTop > panelTop ) {
scrollPosition = panelTop; scrollPosition = panelTop;
} else { } else {
scrollPosition = panelBottom - windowHeight; scrollPosition = panelBottom - windowHeight;

View File

@@ -178,7 +178,8 @@
$.each( $.uls.data.regiongroups, function ( regionCode ) { $.each( $.uls.data.regiongroups, function ( regionCode ) {
$section = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', 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' ) .addClass( 'eleven columns uls-lcd-region-section uls-lcd-region-title offset-by-one' )
.text( regions[regionCode] ); .text( regions[regionCode] );
@@ -214,7 +215,8 @@
quickList.sort( $.uls.data.sortByAutonym ); quickList.sort( $.uls.data.sortByAutonym );
$quickListSection = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', 'uls-lcd-quicklist' ); $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' ) .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 .text( 'Common languages' ); // This is placeholder text if jquery.i18n not present
$quickListSection.append( $quickListSectionTitle ); $quickListSection.append( $quickListSectionTitle );