diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-05-16 15:41:49 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:16:23 -0500 |
commit | 8a1ac197778aaf654472788d10461c855dca3b10 (patch) | |
tree | 1c9933aad0eedd917168fa022a829f74ef49e898 /app/javascript/flavours/glitch/util/emoji | |
parent | 506d2e9cf05bf9c2f927d581f52e1e268b724092 (diff) |
when autoplay is off play animated emoji on hover
Diffstat (limited to 'app/javascript/flavours/glitch/util/emoji')
-rw-r--r-- | app/javascript/flavours/glitch/util/emoji/index.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/util/emoji/index.js b/app/javascript/flavours/glitch/util/emoji/index.js index 82a1ef89c..2205cd7a3 100644 --- a/app/javascript/flavours/glitch/util/emoji/index.js +++ b/app/javascript/flavours/glitch/util/emoji/index.js @@ -28,8 +28,11 @@ const emojify = (str, customEmojis = {}) => { // now got a replacee as ':shortname:' // if you want additional emoji handler, add statements below which set replacement and return true. if (shortname in customEmojis) { - const filename = autoPlayGif ? customEmojis[shortname].url : customEmojis[shortname].static_url; - replacement = `<img draggable="false" class="emojione" alt="${shortname}" title="${shortname}" src="${filename}" />`; + if (autoPlayGif) { + replacement = `<img draggable="false" class="emojione" alt="${shortname}" title="${shortname}" src="${customEmojis[shortname].url}" />`; + } else { + replacement = `<img draggable="false" class="emojione hoverplay" alt="${shortname}" title="${shortname}" src="${customEmojis[shortname].static_url}" style="background-image:url(${customEmojis[shortname].url})" />`; + } return true; } return false; |