From 0766d360c1ee14c54ae5166e553392b6c8d6c29f Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Tue, 30 Jun 2020 00:10:13 +0200 Subject: [PATCH] Move check outside of loop --- src/components/images/imageLoader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/images/imageLoader.js b/src/components/images/imageLoader.js index b153331801..9981430a64 100644 --- a/src/components/images/imageLoader.js +++ b/src/components/images/imageLoader.js @@ -119,9 +119,9 @@ import 'css!./style'; } export function lazyChildren(elem) { - for (const lazyElem of elem.getElementsByClassName('lazy')) { - if (userSettings.enableBlurhash()) { - var blurhashstr = lazyElem.getAttribute('data-blurhash'); + if (userSettings.enableBlurhash()) { + for (const lazyElem of elem.getElementsByClassName('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')) {