mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Add loading="lazy" lazy loading to <img> presenters
This commit is contained in:
parent
f72c0c8695
commit
7b68ebe298
3 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@
|
|||
</video>
|
||||
|
||||
<div v-else-if="media.type == 'Image'" slot="img" :class="media.filter_class" v-on:click="$emit('lightbox', media)">
|
||||
<img class="d-block img-fluid w-100" :src="media.url" :alt="media.description" :title="media.description">
|
||||
<img class="d-block img-fluid w-100" :src="media.url" :alt="media.description" :title="media.description" loading="lazy">
|
||||
</div>
|
||||
|
||||
<p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
|
||||
|
@ -43,7 +43,7 @@
|
|||
</video>
|
||||
|
||||
<div v-else-if="media.type == 'Image'" slot="img" :class="media.filter_class" v-on:click="$emit('lightbox', media)">
|
||||
<img class="d-block img-fluid w-100" :src="media.url" :alt="media.description" :title="media.description">
|
||||
<img class="d-block img-fluid w-100" :src="media.url" :alt="media.description" :title="media.description" loading="lazy">
|
||||
</div>
|
||||
|
||||
<p v-else class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
>
|
||||
<b-carousel-slide v-for="(img, index) in status.media_attachments" :key="img.id">
|
||||
<div slot="img" :class="img.filter_class + ' d-block mx-auto text-center'" style="max-height: 600px;" v-on:click="$emit('lightbox', img)">
|
||||
<img class="img-fluid" style="max-height: 600px;" :src="img.url" :alt="img.description" :title="img.description">
|
||||
<img class="img-fluid" style="max-height: 600px;" :src="img.url" :alt="img.description" :title="img.description" loading="lazy">
|
||||
</div>
|
||||
</b-carousel-slide>
|
||||
<span class="badge badge-dark box-shadow" style="position: absolute;top:10px;right:10px;">
|
||||
|
@ -33,7 +33,7 @@
|
|||
>
|
||||
<b-carousel-slide v-for="(img, index) in status.media_attachments" :key="img.id" :alt="img.description" :title="img.description">
|
||||
<div slot="img" :class="img.filter_class + ' d-block mx-auto text-center'" style="max-height: 600px;" v-on:click="$emit('lightbox', img)">
|
||||
<img class="img-fluid" style="max-height: 600px;" :src="img.url">
|
||||
<img class="img-fluid" style="max-height: 600px;" :src="img.url" loading="lazy">
|
||||
</div>
|
||||
</b-carousel-slide>
|
||||
<span class="badge badge-dark box-shadow" style="position: absolute;top:10px;right:10px;">
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
<p class="font-weight-light">(click to show)</p>
|
||||
</summary>
|
||||
<div class="max-hide-overflow" v-on:click="$emit('lightbox', status.media_attachments[0])" :class="status.media_attachments[0].filter_class" :alt="status.media_attachments[0].description" :title="status.media_attachments[0].description">
|
||||
<img class="card-img-top" :src="status.media_attachments[0].url">
|
||||
<img class="card-img-top" :src="status.media_attachments[0].url" loading="lazy">
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div :class="status.media_attachments[0].filter_class" v-on:click="$emit('lightbox', status.media_attachments[0])" :alt="status.media_attachments[0].description" :title="status.media_attachments[0].description">
|
||||
<img class="card-img-top" :src="status.media_attachments[0].url">
|
||||
<img class="card-img-top" :src="status.media_attachments[0].url" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue