Misc. performance tweaks

* Do not hit search API if there are results to show from front end
* Avoid the lcd exists check
* slightly reduce the timeout of search term typing
* show autofill for search api results too.
* correct the tooltip text of results.

Change-Id: Id102fbf3bc09eb926d9e36f125ed6291943007f9
This commit is contained in:
Santhosh Thottingal
2012-08-04 11:30:37 +05:30
parent 8813bddbba
commit 16c82503fb
2 changed files with 16 additions and 21 deletions

View File

@@ -35,16 +35,7 @@
var that = this;
this.addToRegion( langCode, regionCode, languageName );
},
/**
* Check whether a language code is already displayed or not.
* @param langCode
* @return boolean
*/
exists: function( langCode ) {
return this.$element.find( 'li' ).filter(function() {
return $(this).data('code') === langCode;
} ).length > 0;
},
/**
* Add the language to a region.
* If the region parameter is given , add to that region alone
@@ -55,10 +46,7 @@
*/
addToRegion: function( langCode, region, languageName) {
var that = this;
if ( that.exists( langCode ) ) {
return;
}
var language = $.uls.data.languages[langCode],
var language = that.options.languages[langCode],
langName = languageName
|| $.uls.data.autonym( langCode )
|| that.options.languages[langCode]
@@ -125,6 +113,10 @@
this.$element.find( 'div' ).hide();
},
focus: function() {
this.$element.focus();
},
listen: function() {
var that = this;
// The region section need to be in sync with the map filter.