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 68386eef34
commit 299744c038

View File

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