Lazy load all message images

This commit is contained in:
the-djmaze 2022-09-26 10:58:46 +02:00
parent 0953d0d76e
commit c6652ba9b4

View file

@ -230,6 +230,7 @@ export const
delAttribute('src'); delAttribute('src');
if ('IMG' === name) { if ('IMG' === name) {
oElement.loading = 'lazy';
let attachment; let attachment;
if (detectHiddenImages if (detectHiddenImages
&& (('' != getAttribute('height') && 3 > pInt(getAttribute('height'))) && (('' != getAttribute('height') && 3 > pInt(getAttribute('height')))
@ -248,7 +249,6 @@ export const
else if ((attachment = findLocationByCid(value))) else if ((attachment = findLocationByCid(value)))
{ {
if (attachment.download) { if (attachment.download) {
oElement.loading = 'lazy';
oElement.src = attachment.linkPreview(); oElement.src = attachment.linkPreview();
attachment.isLinked(true); attachment.isLinked(true);
} }