Merge pull request #210 from wikimedia/209

Remove unwanted script related code in search method
This commit is contained in:
Niklas Laxström
2016-04-06 15:03:03 +03:00

View File

@@ -162,22 +162,13 @@
} }
}, },
search: function() { search: function () {
var languagesInScript, var langCode,
query = $.trim( this.$element.val() ), query = $.trim( this.$element.val() );
languages = $.uls.data.getLanguagesByScriptGroup( this.options.languages ),
scriptGroup, langNum, langCode;
this.resultCount = 0; this.resultCount = 0;
for ( scriptGroup in languages ) { for ( langCode in this.options.languages ) {
languagesInScript = languages[scriptGroup];
languagesInScript.sort( $.uls.data.sortByAutonym );
for ( langNum = 0; langNum < languagesInScript.length; langNum++ ) {
langCode = languagesInScript[langNum];
if ( query === '' || this.filter( langCode, query ) ) { if ( query === '' || this.filter( langCode, query ) ) {
if ( this.resultCount === 0 ) { if ( this.resultCount === 0 ) {
// Autofill the first result. // Autofill the first result.
@@ -193,7 +184,6 @@
} }
} }
} }
}
// Also do a search by search API // Also do a search by search API
if( !this.resultCount && this.options.searchAPI && query ) { if( !this.resultCount && this.options.searchAPI && query ) {