Fix code to be equivalent to the previous one

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-09-25 07:55:40 +02:00
parent 27f74b3ebd
commit 1a2476609c
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

@ -24,16 +24,19 @@ function remoteRender(event: MessageEvent): void {
// Apply image style after so we can steal the anchor's colour.
// Style copied from a rendered version of mx_MFileBody_download_icon
// @ts-ignore
img.style = data.imgStyle ?? "";
img.style.width = "12px";
img.style.height = "12px";
img.style.webkitMaskSize = "12px";
img.style.webkitMaskPosition = "center";
img.style.webkitMaskRepeat = "no-repeat";
img.style.display = "inline-block";
img.style.webkitMaskImage = `url('${data.imgSrc}')`;
img.style.backgroundColor = `${a.style.color}`;
if (data.imgStyle) {
// @ts-ignore
img.style = data.imgStyle;
} else {
img.style.width = "12px";
img.style.height = "12px";
img.style.webkitMaskSize = "12px";
img.style.webkitMaskPosition = "center";
img.style.webkitMaskRepeat = "no-repeat";
img.style.display = "inline-block";
img.style.webkitMaskImage = `url('${data.imgSrc}')`;
img.style.backgroundColor = `${a.style.color}`;
}
const body = document.body;
// Don't display scrollbars if the link takes more than one line to display.