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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user