export validEmojiNames for autocomplete

This commit is contained in:
Mike Greiling 2017-06-26 22:48:41 -05:00
parent 527e7edbc4
commit 88114c41fb
2 changed files with 3 additions and 2 deletions

View file

@ -55,4 +55,5 @@ export {
getUnicodeSupportMap, getUnicodeSupportMap,
isEmojiNameValid, isEmojiNameValid,
isEmojiUnicodeSupported, isEmojiUnicodeSupported,
validEmojiNames,
}; };

View file

@ -1,5 +1,5 @@
import { glEmojiTag } from './behaviors/gl_emoji'; import { glEmojiTag } from './behaviors/gl_emoji';
import { emojiMap, emojiAliases } from './emoji'; import { validEmojiNames } from './emoji';
import glRegexp from './lib/utils/regexp'; import glRegexp from './lib/utils/regexp';
import AjaxCache from './lib/utils/ajax_cache'; import AjaxCache from './lib/utils/ajax_cache';
@ -374,7 +374,7 @@ class GfmAutoComplete {
if (this.cachedData[at]) { if (this.cachedData[at]) {
this.loadData($input, at, this.cachedData[at]); this.loadData($input, at, this.cachedData[at]);
} else if (GfmAutoComplete.atTypeMap[at] === 'emojis') { } else if (GfmAutoComplete.atTypeMap[at] === 'emojis') {
this.loadData($input, at, Object.keys(emojiMap).concat(Object.keys(emojiAliases))); this.loadData($input, at, validEmojiNames);
} else { } else {
AjaxCache.retrieve(this.dataSources[GfmAutoComplete.atTypeMap[at]], true) AjaxCache.retrieve(this.dataSources[GfmAutoComplete.atTypeMap[at]], true)
.then((data) => { .then((data) => {