diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-06-27 01:05:43 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-06-27 06:50:57 +0300 |
commit | 527e7edbc4251644867ef02a2e055815d3f28a82 (patch) | |
tree | 835019d8ee9f397f34fa85299cf052894acfa319 /app/assets/javascripts/behaviors | |
parent | 82d67f700e13dc1958c63ab71b319df0dbea47d8 (diff) |
replace emojiAlias references with normalizeEmojiName helper
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/gl_emoji.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/assets/javascripts/behaviors/gl_emoji.js b/app/assets/javascripts/behaviors/gl_emoji.js index 06eb698378c..3a29254cf99 100644 --- a/app/assets/javascripts/behaviors/gl_emoji.js +++ b/app/assets/javascripts/behaviors/gl_emoji.js @@ -1,5 +1,5 @@ import installCustomElements from 'document-register-element'; -import { emojiMap, emojiAliases, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji'; +import { emojiMap, normalizeEmojiName, isEmojiUnicodeSupported, getUnicodeSupportMap } from '../emoji'; installCustomElements(window); @@ -10,8 +10,7 @@ function emojiImageTag(name, src) { } function assembleFallbackImageSrc(inputName) { - let name = Object.prototype.hasOwnProperty.call(emojiAliases, inputName) ? - emojiAliases[inputName] : inputName; + let name = normalizeEmojiName(inputName); let emojiInfo = emojiMap[name]; // Fallback to question mark for unknown emojis if (!emojiInfo) { @@ -25,8 +24,7 @@ function assembleFallbackImageSrc(inputName) { function glEmojiTag(inputName, options) { const opts = { sprite: false, forceFallback: false, ...options }; - let name = Object.prototype.hasOwnProperty.call(emojiAliases, inputName) ? - emojiAliases[inputName] : inputName; + let name = normalizeEmojiName(inputName); let emojiInfo = emojiMap[name]; // Fallback to question mark for unknown emojis if (!emojiInfo) { |