Add thumbnail asset preview to list view assets [SCI-9014]

This commit is contained in:
Giga Chubinidze 2023-08-22 05:55:20 +04:00
parent f21c1ba7c5
commit c699095d1a
2 changed files with 33 additions and 4 deletions

View file

@ -248,6 +248,23 @@
@include font-main; @include font-main;
} }
.attachment-image-tooltip {
display: none;
z-index: 9999;
position: relative;
right: 110px;
bottom: 90px;
img {
width: 150px;
height: 150px;
}
}
.file-preview-link:hover + .attachment-image-tooltip {
display: block;
}
.file-name { .file-name {
@include font-main; @include font-main;
color: $brand-primary; color: $brand-primary;

View file

@ -11,12 +11,14 @@
:data-gallery-view-id="parentId" :data-gallery-view-id="parentId"
:data-preview-url="attachment.attributes.urls.preview" :data-preview-url="attachment.attributes.urls.preview"
> >
<span data-toggle="tooltip" <span class="attachment-name" data-toggle="tooltip"
data-placement="bottom" data-placement="bottom">
:title="`${ attachment.attributes.file_name }`">
{{ attachment.attributes.file_name }} {{ attachment.attributes.file_name }}
</span> </span>
</a> </a>
<div class="attachment-image-tooltip" >
<img :src="this.imageLoadError ? attachment.attributes.urls.blob : attachment.attributes.medium_preview" @error="handleImageError"/>
</div>
<span v-if="attachment.isNewUpload" class="attachment-label-new"> <span v-if="attachment.isNewUpload" class="attachment-label-new">
{{ i18n.t('attachments.new.description') }} {{ i18n.t('attachments.new.description') }}
</span> </span>
@ -53,7 +55,17 @@
parentId: { parentId: {
type: Number, type: Number,
required: true required: true
} },
}, },
data() {
return {
imageLoadError: false
};
},
methods: {
handleImageError() {
this.imageLoadError = true;
}
}
} }
</script> </script>