mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Lazy load integration images (#25024)
This commit is contained in:
parent
80f2e66e89
commit
674ef79531
@ -161,9 +161,9 @@ allComponents.pop(); // remove placeholder element at the end
|
|||||||
components: [],
|
components: [],
|
||||||
image: function () {
|
image: function () {
|
||||||
if (this.logo === '') {
|
if (this.logo === '') {
|
||||||
return '<img src="https://brands.home-assistant.io/_/' + this.domain + '/logo.png" srcset="https://brands.home-assistant.io/_/' + this.domain + '/logo@2x.png 2x">';
|
return '<img src="https://brands.home-assistant.io/_/' + this.domain + '/logo.png" srcset="https://brands.home-assistant.io/_/' + this.domain + '/logo@2x.png 2x" loading="lazy">';
|
||||||
} else {
|
} else {
|
||||||
return '<img data-src="/images/supported_brands/' + this.logo + '">';
|
return '<img data-src="/images/supported_brands/' + this.logo + '" loading="lazy">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user