1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-17 12:15:47 +02:00

Fix freshly broken GIF previews in notifications

This commit is contained in:
chylex 2018-05-04 21:07:33 +02:00
parent e7ee1d6be7
commit 47eec14bca

View File

@ -146,7 +146,7 @@
}; };
let fixMedia = (html, media) => { let fixMedia = (html, media) => {
return html.find(".js-media a[data-media-entity-id='"+media.mediaId+"']").css("background-image", 'url("'+media.small()+'")').removeClass("is-zoomable"); return html.find("a[data-media-entity-id='"+media.mediaId+"'], .media-item").first().removeClass("is-zoomable").css("background-image", 'url("'+media.small()+'")');
}; };
return function(column, tweet){ return function(column, tweet){
@ -181,13 +181,15 @@
if (previews){ if (previews){
html.find(".reverse-image-search").remove(); html.find(".reverse-image-search").remove();
let container = html.find(".js-media");
for(let media of tweet.getMedia()){ for(let media of tweet.getMedia()){
fixMedia(html, media); fixMedia(container, media);
} }
if (tweet.quotedTweet){ if (tweet.quotedTweet){
for(let media of tweet.quotedTweet.getMedia()){ for(let media of tweet.quotedTweet.getMedia()){
fixMedia(html, media).addClass("media-size-medium"); fixMedia(container, media).addClass("media-size-medium");
} }
} }
} }