mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
#885 fix other thumbnail
This commit is contained in:
@@ -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
|
||||
|
@@ -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>
|
||||
|
@@ -1,8 +1 @@
|
||||
.media-viewer{
|
||||
width: 340px;
|
||||
height: 279px;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user