FIX: not doing non leading word match in emoji autocomplete
This commit is contained in:
parent
ff37685aef
commit
c665607f72
|
@ -254,7 +254,7 @@ Discourse.Emoji.search = function(term, options) {
|
|||
|
||||
for (i=0; i<toSearch.length; i++) {
|
||||
item = toSearch[i];
|
||||
if (item.indexOf(term) === 0 && addResult(item)) {
|
||||
if (item.indexOf(term) > 0 && addResult(item)) {
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,4 +28,7 @@ test("Emoji.search", function(){
|
|||
// able to find an alias
|
||||
equal(Discourse.Emoji.search("+1").length, 1);
|
||||
|
||||
// able to find middle of line search
|
||||
equal(Discourse.Emoji.search("check", {maxResults: 3}).length, 3);
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue