Skip to content

Commit 6bd3128

Browse files
committed
correct eventhandler for tenor gifs
1 parent 523ff79 commit 6bd3128

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

LxBTSC/template/chat.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,16 @@
139139
toggleEmoteMenu();
140140
hideTooltip();
141141
}
142-
})
142+
});
143+
144+
$(document.getElementById('tenor')).on('click', '.tenor-gif', function(e) {
145+
qtObject.emoteClicked(this.getAttribute('share-url'));
146+
registerShare(this.getAttribute('share-id'));
147+
if(!e.shiftKey) {
148+
toggleEmoteMenu();
149+
hideTooltip();
150+
}
151+
});
143152
};
144153

145154
function showTooltip(elem) {

LxBTSC/template/js/tenor.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ function searchAppendCallback(json) {
7676
img.setAttribute('share-url', element['media'][0]['gif']['url']);
7777
img.setAttribute('share-id', element['id']);
7878
img.src = element['media'][0]['nanogif']['url'];
79-
img.onclick = function() {
80-
emoteClicked(this.getAttribute('share-url'), false);
81-
registerShare(this.getAttribute('share-id'));
82-
};
8379
elem.appendChild(img);
8480
});
8581
}

0 commit comments

Comments
 (0)