LT-383: Picking an image from the middle of a series for thumbnails
This commit is contained in:
parent
79f3c482c1
commit
9fc538d5d4
@ -8,7 +8,9 @@ Template.imageThumbnail.onCreated(() => {
|
|||||||
// Get the image ID for current thumbnail
|
// Get the image ID for current thumbnail
|
||||||
instance.getThumbnailImageId = () => {
|
instance.getThumbnailImageId = () => {
|
||||||
const stack = instance.data.thumbnail.stack;
|
const stack = instance.data.thumbnail.stack;
|
||||||
const imageInstance = stack.images[0];
|
const lastIndex = (stack.images.length || 1) - 1;
|
||||||
|
const imageIndex = Math.floor(lastIndex / 2);
|
||||||
|
const imageInstance = stack.images[imageIndex];
|
||||||
return getImageId(imageInstance);
|
return getImageId(imageInstance);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user