client/posts: display thumbnail while original image is loading
This commit is contained in:
parent
f956d8033c
commit
5877ad9463
1 changed files with 12 additions and 1 deletions
|
@ -119,7 +119,18 @@ class PostContentControl {
|
||||||
post: this._post,
|
post: this._post,
|
||||||
autoplay: settings.get().autoplayVideos,
|
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");
|
newNode.classList.add("transparency-grid");
|
||||||
}
|
}
|
||||||
if (this._postContentNode) {
|
if (this._postContentNode) {
|
||||||
|
|
Reference in a new issue