]> cat aescling's git repositories - mastodon.git/commitdiff
Show emoji shortname by a tooltip (#2784)
authorunarist <m.unarist@gmail.com>
Thu, 4 May 2017 13:50:09 +0000 (22:50 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 4 May 2017 13:50:09 +0000 (15:50 +0200)
app/javascript/mastodon/emoji.js

index eee657b86c81e4f5367f9f8bc76d8df7e4592eff..01d01fb720891c3231e6534aec56e4c8357fe09b 100644 (file)
@@ -15,7 +15,7 @@ const unicodeToImage = str => {
     const filename = emojione.emojioneList[short].fname;
     const alt      = emojione.convert(unicode.toUpperCase());
 
-    return `<img draggable="false" class="emojione" alt="${alt}" src="/emoji/${filename}.svg" />`;
+    return `<img draggable="false" class="emojione" alt="${alt}" title="${short}" src="/emoji/${filename}.svg" />`;
   });
 };
 
@@ -27,7 +27,7 @@ const shortnameToImage = str => str.replace(emojione.regShortNames, shortname =>
   const unicode = emojione.emojioneList[shortname].unicode[emojione.emojioneList[shortname].unicode.length - 1];
   const alt     = emojione.convert(unicode.toUpperCase());
 
-  return `<img draggable="false" class="emojione" alt="${alt}" src="/emoji/${unicode}.svg" />`;
+  return `<img draggable="false" class="emojione" alt="${alt}" title="${shortname}" src="/emoji/${unicode}.svg" />`;
 });
 
 export default function emojify(text) {