Don't autocomplete emoji until the 2nd letter 💻

(imported from commit 25986e2c3d939b61c4eb71596944748522d2cb54)
This commit is contained in:
Leo Franchi 2013-07-11 11:16:32 -04:00
parent b5273b4c25
commit 8c7156acfa
1 changed files with 7 additions and 2 deletions

View File

@ -37,7 +37,7 @@ function composebox_typeahead_highlighter(item) {
return typeahead_helper.highlight_with_escaping(this.query, item);
}
function query_matches_person (query, person) {
function query_matches_person(query, person) {
// Case-insensitive.
query = query.toLowerCase();
@ -46,7 +46,12 @@ function query_matches_person (query, person) {
}
function query_matches_emoji (query, emoji) {
function query_matches_emoji(query, emoji) {
// We don't want to match non-emoji emoticons such
// as :P or :-p
if (/^-?.$/.test(query)) {
return false;
}
return (emoji.emoji_name.indexOf(query.toLowerCase()) !== -1);
}