mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Set background color on blurhash image load
This commit is contained in:
parent
808a670b55
commit
5e1d4edd87
1 changed files with 2 additions and 0 deletions
|
@ -87,6 +87,7 @@ import 'css!./style';
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (elem.tagName !== 'IMG') {
|
if (elem.tagName !== 'IMG') {
|
||||||
elem.style.backgroundImage = "url('" + url + "')";
|
elem.style.backgroundImage = "url('" + url + "')";
|
||||||
|
elem.style.backgroundColor = '#fff';
|
||||||
} else {
|
} else {
|
||||||
elem.setAttribute('src', url);
|
elem.setAttribute('src', url);
|
||||||
}
|
}
|
||||||
|
@ -108,6 +109,7 @@ import 'css!./style';
|
||||||
if (elem.tagName !== 'IMG') {
|
if (elem.tagName !== 'IMG') {
|
||||||
url = elem.style.backgroundImage.slice(4, -1).replace(/"/g, '');
|
url = elem.style.backgroundImage.slice(4, -1).replace(/"/g, '');
|
||||||
elem.style.backgroundImage = 'none';
|
elem.style.backgroundImage = 'none';
|
||||||
|
elem.style.backgroundColor = null;
|
||||||
} else {
|
} else {
|
||||||
url = elem.getAttribute('src');
|
url = elem.getAttribute('src');
|
||||||
elem.setAttribute('src', '');
|
elem.setAttribute('src', '');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue