1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #1823 from thornbill/extra-blury

Set background color on blurhash image load

(cherry picked from commit 5a2c0beec5)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
Anthony Lavado 2020-08-19 15:11:57 -04:00 committed by Joshua M. Boniface
parent 5f1af65c2e
commit c9ed8c750e

View file

@ -87,6 +87,9 @@ import 'css!./style';
requestAnimationFrame(() => {
if (elem.tagName !== 'IMG') {
elem.style.backgroundImage = "url('" + url + "')";
if (elem.classList.contains('blurhashed')) {
elem.style.backgroundColor = '#fff';
}
} else {
elem.setAttribute('src', url);
}
@ -108,6 +111,7 @@ import 'css!./style';
if (elem.tagName !== 'IMG') {
url = elem.style.backgroundImage.slice(4, -1).replace(/"/g, '');
elem.style.backgroundImage = 'none';
elem.style.backgroundColor = null;
} else {
url = elem.getAttribute('src');
elem.setAttribute('src', '');