Contain images without dims (#176)

pull/221/head
Varun Patil 2022-11-09 18:21:56 -08:00
parent faa0866229
commit 699901c243
1 changed files with 6 additions and 1 deletions

View File

@ -470,7 +470,8 @@ export default class Viewer extends Mixins(GlobalMixin) {
// Get the thumbnail image // Get the thumbnail image
this.photoswipe.addFilter("thumbEl", (thumbEl, data, index) => { this.photoswipe.addFilter("thumbEl", (thumbEl, data, index) => {
const photo = this.list[index - this.globalAnchor]; const photo = this.list[index - this.globalAnchor];
if (!photo || photo.flag & this.c.FLAG_IS_VIDEO) return thumbEl; if (!photo || !photo.w || !photo.h || photo.flag & this.c.FLAG_IS_VIDEO)
return thumbEl;
return this.thumbElem(photo) || thumbEl; return this.thumbElem(photo) || thumbEl;
}); });
@ -840,6 +841,10 @@ export default class Viewer extends Mixins(GlobalMixin) {
width: 100%; width: 100%;
} }
img.pswp__img {
object-fit: contain;
}
.pswp__button { .pswp__button {
color: white; color: white;