From 299744c0386781b7d05e7c9ebcf97fa5912d48b2 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Mon, 6 Aug 2012 14:19:58 +0530 Subject: [PATCH] Do not perform full search on page load Do it on first click. Change-Id: I403aef108cf5d4993f6e8fbc9ebf372893e48e3d --- src/jquery.uls.core.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 3581e9a..31fc967 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -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; },