mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: not doing non leading word match in emoji autocomplete
This commit is contained in:
parent
ff37685aef
commit
c665607f72
2 changed files with 4 additions and 1 deletions
|
@ -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 a new issue