Commit 81a37ca1 authored by Phil Hughes's avatar Phil Hughes

Moved the title onto the emoji tag

This adds the description in all places emojis are used
parent 4bde6eae
......@@ -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;
})();
......
......@@ -62,6 +62,7 @@ function glEmojiTag(inputName, options) {
data-fallback-src="${fallbackImageSrc}"
${fallbackSpriteAttribute}
data-unicode-version="${emojiInfo.unicodeVersion}"
title=${emojiInfo.description}
>
${contents}
</gl-emoji>
......
......@@ -54,7 +54,7 @@ module Gitlab
unicode_version: emoji_unicode_version(emoji_name)
}
ActionController::Base.helpers.content_tag('gl-emoji', emoji_info['moji'], data: data)
ActionController::Base.helpers.content_tag('gl-emoji', emoji_info['moji'], title: emoji_info['description'], data: data)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment