#885 fix other thumbnail

This commit is contained in:
Dániel Péter Sipos
2020-11-03 13:27:17 +01:00
parent 66f0b5f77d
commit 263c12e8f2
3 changed files with 15 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ import { NgxGalleryAnimation } from '@kolkov/ngx-gallery';
})
export class MediaViewerImageComponent implements OnInit {
@Input() images: MediaViewerItem[];
@Input() image: string;
galleryOptions: NgxGalleryOptions[];
galleryImages: NgxGalleryImage[];
@@ -32,8 +33,19 @@ export class MediaViewerImageComponent implements OnInit {
imageAnimation: NgxGalleryAnimation.Slide,
},
];
if (this.image) {
this.galleryImages = [
{
small: this.image,
medium: this.image,
big: this.image,
},
];
} else {
this.galleryImages = this.convertToGalleryImage(this.images);
}
}
/**
* This method convert an array of MediaViewerItem into NgxGalleryImage array

View File

@@ -22,7 +22,7 @@
mediaList[0]?.format !== 'audio'
"
>
<img [src]="mediaList[0]?.thumbnail || thumbnailPlaceholder" alt="" />
<ds-media-viewer-image [image]="mediaList[0]?.thumbnail || thumbnailPlaceholder"></ds-media-viewer-image>
</ng-container>
</div>
</ng-container>

View File

@@ -1,8 +1 @@
.media-viewer{
width: 340px;
height: 279px;
img{
width: 100%;
height: 100%;
}
}