prevent timing issue when autosuggest is too slow
This commit is contained in:
parent
56644c9d1e
commit
406622eeed
1 changed files with 7 additions and 3 deletions
|
|
@ -20,8 +20,12 @@ var Search = {
|
|||
return results;
|
||||
},
|
||||
selectItemCallback : function(event, data, formatted) {
|
||||
$(Search.selector).val(formatted);
|
||||
window.location = data['url'];
|
||||
if (data['id'] !== undefined) { // actual result
|
||||
$(Search.selector).val(formatted);
|
||||
window.location = data['url'];
|
||||
} else { //use form val to eliminate timing issue
|
||||
window.location = '/people?q='+$(Search.selector).val();
|
||||
}
|
||||
},
|
||||
options : function(){return {
|
||||
minChars : 3,
|
||||
|
|
@ -33,7 +37,7 @@ var Search = {
|
|||
extraParams : {limit : 4},
|
||||
formatItem : Search.formatItem,
|
||||
formatResult : Search.formatResult,
|
||||
parse : Search.parse,
|
||||
parse : Search.parse
|
||||
};},
|
||||
|
||||
searchLinkli : function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue