Introduce lazyload option with default value true.

This can be set false when language list is very small.

Change-Id: I024f01a2a62f0d0def553e2d6f7a3fdcce1a7968
This commit is contained in:
Santhosh Thottingal
2012-10-26 10:53:13 +05:30
parent 5c6d244c97
commit 642668d0ae
2 changed files with 11 additions and 8 deletions

View File

@@ -262,11 +262,11 @@
var $ulsLanguageList = $( this ),
scrollTop = $ulsLanguageList.position().top,
scrollBottom = $ulsLanguageList.height();
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) {
lcd.$element.trigger( 'scrollend' );
if ( lcd.options.lazyload ) {
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) {
lcd.$element.trigger( 'scrollend' );
}
}
// The region section need to be in sync with the map filter.
var inviewRegion = 'WW';
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
@@ -304,7 +304,8 @@
};
$.fn.lcd.defaults = {
languages: null
languages: null,
lazyload: true
};
$.fn.lcd.Constructor = LanguageCategoryDisplay;