improve loading of channels
This commit is contained in:
parent
9e9ebb506b
commit
032e1b5be6
12 changed files with 276 additions and 100 deletions
|
@ -132,6 +132,17 @@ class Embed {
|
|||
full.show();
|
||||
};
|
||||
img.src = this.json.thumbnail.proxy_url;
|
||||
if (this.json.thumbnail.width) {
|
||||
let scale = 1;
|
||||
const max = 96 * 3;
|
||||
scale = Math.max(scale, this.json.thumbnail.width / max);
|
||||
scale = Math.max(scale, this.json.thumbnail.height / max);
|
||||
this.json.thumbnail.width /= scale;
|
||||
this.json.thumbnail.height /= scale;
|
||||
}
|
||||
img.style.width = this.json.thumbnail.width + "px";
|
||||
img.style.height = this.json.thumbnail.height + "px";
|
||||
console.log(this.json, "Image fix");
|
||||
return img;
|
||||
}
|
||||
generateLink() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue