diff options
author | Phil Hughes <me@iamphill.com> | 2017-04-24 17:05:59 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-24 17:08:12 +0100 |
commit | 81a37ca1ee6d57e24633921fb6edee319f18887b (patch) | |
tree | 60538087ff0c9385b784a3a17d73fcab4a275610 /app/assets | |
parent | 4bde6eae51a43f37326f53363e6e4f21c5a3c295 (diff) | |
download | gitlab-ce-81a37ca1ee6d57e24633921fb6edee319f18887b.tar.gz |
Moved the title onto the emoji tag
This adds the description in all places emojis are used
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/awards_handler.js | 17 | ||||
-rw-r--r-- | app/assets/javascripts/behaviors/gl_emoji.js | 1 |
2 files changed, 6 insertions, 12 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index e0c592ef73d..adb45b0606d 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -29,18 +29,11 @@ const categoryLabelMap = { flags: 'Flags', }; -function createEmojiObject(alias) { - return { - alias, - description: emojiMap[alias].description, - }; -}; - function buildCategoryMap() { return Object.keys(emojiMap).reduce((currentCategoryMap, emojiNameKey) => { const emojiInfo = emojiMap[emojiNameKey]; if (currentCategoryMap[emojiInfo.category]) { - currentCategoryMap[emojiInfo.category].push(createEmojiObject(emojiNameKey)); + currentCategoryMap[emojiInfo.category].push(emojiNameKey); } return currentCategoryMap; @@ -62,10 +55,10 @@ function renderCategory(name, emojiList, opts = {}) { ${name} </h5> <ul class="clearfix emoji-menu-list ${opts.menuListClass || ''}"> - ${emojiList.map(emoji => ` + ${emojiList.map(emojiName => ` <li class="emoji-menu-list-item"> - <button class="emoji-menu-btn text-center js-emoji-btn" type="button" title="${emoji.description}"> - ${glEmojiTag(emoji.alias, { + <button class="emoji-menu-btn text-center js-emoji-btn" type="button"> + ${glEmojiTag(emojiName, { sprite: true, })} </button> @@ -505,7 +498,7 @@ AwardsHandler.prototype.getFrequentlyUsedEmojis = function getFrequentlyUsedEmoj const frequentlyUsedEmojis = _.uniq((Cookies.get('frequently_used_emojis') || '').split(',')); this.frequentlyUsedEmojis = frequentlyUsedEmojis.filter( inputName => isEmojiNameValid(inputName), - ).map(emojiNameKey => createEmojiObject(emojiNameKey)); + ); return this.frequentlyUsedEmojis; })(); diff --git a/app/assets/javascripts/behaviors/gl_emoji.js b/app/assets/javascripts/behaviors/gl_emoji.js index 19a607309e4..f3863d9e495 100644 --- a/app/assets/javascripts/behaviors/gl_emoji.js +++ b/app/assets/javascripts/behaviors/gl_emoji.js @@ -62,6 +62,7 @@ function glEmojiTag(inputName, options) { data-fallback-src="${fallbackImageSrc}" ${fallbackSpriteAttribute} data-unicode-version="${emojiInfo.unicodeVersion}" + title=${emojiInfo.description} > ${contents} </gl-emoji> |