Skip to content

Commit

Permalink
feat: add option to hide placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Jul 16, 2024
1 parent f3200a8 commit 269ebf5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Document/DocumentThumbnail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export default {
ratio: {
type: Number,
default: null
},
/**
* Make sure the placeholder is never visible
*/
hidePlaceholder: {
type: Boolean
}
},
data() {
Expand All @@ -101,6 +107,7 @@ export default {
computed: {
thumbnailClass() {
return {
'document-thumbnail--hide-placeholder': this.hidePlaceholder,
'document-thumbnail--active': this.active,
'document-thumbnail--crop': this.crop,
'document-thumbnail--fit': this.fit,
Expand Down Expand Up @@ -331,6 +338,10 @@ export default {
background: var(--bs-light-bg-subtle);
}
&--hide-placeholder &__placeholder {
display: none;
}
&__overlay {
position: absolute;
z-index: $zindex-overlay;
Expand Down
2 changes: 2 additions & 0 deletions src/stories/components/Document/DocumentThumbnail.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default {
crop: true,
hover: false,
clickable: true,
hidePlaceholder: false,
fit: false,
document: {
extractionLevel: 0,
Expand Down Expand Up @@ -47,6 +48,7 @@ export const WithPlaceholder = {
size: 'xs',
crop: true,
fit: false,
hidePlaceholder: false,
document: {
extractionLevel: 0,
inlineFullUrl: null,
Expand Down

0 comments on commit 269ebf5

Please sign in to comment.