A bit more reasonable autocomplete (II)
This commit is contained in:
parent
9f5bdc3da0
commit
83355f3789
1 changed files with 4 additions and 1 deletions
|
@ -192,6 +192,9 @@ function getTagItOptions()
|
||||||
var term = request.term.toLowerCase();
|
var term = request.term.toLowerCase();
|
||||||
var results = $.grep(this.options.availableTags, function(a)
|
var results = $.grep(this.options.availableTags, function(a)
|
||||||
{
|
{
|
||||||
|
if (term.length < 3)
|
||||||
|
return a.toLowerCase().indexOf(term) == 0;
|
||||||
|
else
|
||||||
return a.toLowerCase().indexOf(term) != -1;
|
return a.toLowerCase().indexOf(term) != -1;
|
||||||
});
|
});
|
||||||
if (!this.options.allowDuplicates)
|
if (!this.options.allowDuplicates)
|
||||||
|
|
Loading…
Reference in a new issue