29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-25 23:02:55 +00:00

Do not set a width of 0 in media thumbnails (#38535)

This commit is contained in:
Allon Moritz 2022-09-02 21:14:35 +02:00 committed by GitHub
parent 7f72d6c1da
commit 1c4fcf60b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@
class="image-cropped"
:src="getURL"
:alt="altTag"
loading="lazy"
:loading="loading"
:width="width"
:height="height"
>
@ -76,10 +76,13 @@ export default {
: `${this.item.thumb_path}`;
},
width() {
return this.item.width;
return this.item.width > 0 ? this.item.width : null;
},
height() {
return this.item.height;
return this.item.height > 0 ? this.item.height : null;
},
loading() {
return this.item.width > 0 ? 'lazy' : null;
},
altTag() {
return this.item.name;