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

multiple imports optimized

This commit is contained in:
vitorsemeano 2020-11-08 12:37:53 +00:00
parent 2243b35311
commit 5b5d6a45b0
7 changed files with 63 additions and 63 deletions

View file

@ -124,16 +124,14 @@ import './style.css';
export function lazyChildren(elem) {
if (userSettings.enableBlurhash()) {
const lazyElems = Array.from(elem.querySelectorAll('.lazy'));
lazyElems.forEach((lazyElem) => {
for (const lazyElem of elem.querySelectorAll('.lazy')) {
const blurhashstr = lazyElem.getAttribute('data-blurhash');
if (!lazyElem.classList.contains('blurhashed', 'non-blurhashable') && blurhashstr) {
itemBlurhashing(lazyElem, blurhashstr);
} else if (!blurhashstr && !lazyElem.classList.contains('blurhashed')) {
lazyElem.classList.add('non-blurhashable');
}
});
}
}
lazyLoader.lazyChildren(elem, fillImage);