Do not perform full search on page load

Do it on first click.

Change-Id: I403aef108cf5d4993f6e8fbc9ebf372893e48e3d
This commit is contained in:
Santhosh Thottingal
2012-08-06 14:19:58 +05:30
parent 12d947860a
commit fc5c291536

View File

@@ -32,6 +32,7 @@
}
}
this.shown = false;
this.initialized = false;
this.$languageFilter = $( 'input#languagefilter' );
this.$noResultsView = $( 'div.uls-no-results-view' );
this.$resultsView = $( 'div.uls-language-list' );
@@ -44,8 +45,7 @@
ULS.prototype = {
constructor: ULS,
ready: function() {
// Initialize with a full search.
this.$languageFilter.val( "" ).languagefilter( "search" );
// Currently empty, can be overridden for anything useful.
},
show: function() {
var pos = $.extend( {}, this.$element.offset(), {
@@ -56,9 +56,14 @@
left: '25%'
} );
if ( !this.initialized ) {
// Initialize with a full search.
// This happens on first time click of uls trigger.
this.$languageFilter.languagefilter( 'clear' );
this.initialized = true;
}
this.$menu.show();
this.shown = true;
this.$languageFilter.focus();
return this;
},