diff --git a/client/js/controls/post_content_control.js b/client/js/controls/post_content_control.js index 55daca76..aca907b0 100644 --- a/client/js/controls/post_content_control.js +++ b/client/js/controls/post_content_control.js @@ -119,7 +119,18 @@ class PostContentControl { post: this._post, autoplay: settings.get().autoplayVideos, }); - if (settings.get().transparencyGrid) { + if (["image", "flash"].includes(this._post.type)) { + newNode.style.backgroundImage = "url("+this._post.thumbnailUrl+")"; + } + if (this._post.type == "image") { + newNode.firstElementChild.addEventListener("load", (e) => { + if (settings.get().transparencyGrid) { + newNode.classList.add("transparency-grid"); + } else { + newNode.style.backgroundImage = ""; + } + }); + } else if (settings.get().transparencyGrid) { newNode.classList.add("transparency-grid"); } if (this._postContentNode) {