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

@@ -162,7 +162,7 @@
this.$resultsView.lcd( 'empty' );
// Use lazy loading only when there are 100+ languages.
if ( count > 100 ) {
if ( this.options.lazyload ) {
this.$regionFilters.first().regionselector( 'show' );
} else{
this.$regionFilters.regionselector( 'show' );
@@ -224,7 +224,8 @@
lcd = that.$resultsView.lcd( {
languages: that.languages,
quickList: that.options.quickList,
clickhandler: $.proxy( that.onSelect, that )
clickhandler: $.proxy( that.onSelect, that ),
lazyload: that.options.lazyload
} ).data( "lcd" );
that.$languageFilter.languagefilter( {
@@ -328,7 +329,8 @@
onSelect: null, // Callback function to be called when a language is selected
searchAPI: null, // Language search API
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
quickList: null // Array of language codes of function that returns such
quickList: null, // Array of language codes of function that returns such
lazyload: true // Lazy load the language list when scrolled.
};
// Define a dummy i18n function, if jquery.i18n not integrated.