better compact attachments
This commit is contained in:
parent
5c2744b426
commit
bfe31e20ea
4 changed files with 20 additions and 13 deletions
|
@ -68,6 +68,7 @@ const Attachment = {
|
|||
'-nsfw-placeholder': this.hidden
|
||||
},
|
||||
'-' + this.type,
|
||||
'-' + this.size,
|
||||
`-${this.useContainFit ? 'contain' : 'cover'}-fit`
|
||||
]
|
||||
},
|
||||
|
@ -102,10 +103,18 @@ const Attachment = {
|
|||
return (this.type === 'html' && !this.attachment.oembed) || this.type === 'unknown'
|
||||
},
|
||||
useModal () {
|
||||
const modalTypes = this.size === 'hide' ? ['image', 'video', 'audio']
|
||||
: this.mergedConfig.playVideosInModal
|
||||
? ['image', 'video']
|
||||
: ['image']
|
||||
let modalTypes = []
|
||||
switch (this.size) {
|
||||
case 'hide':
|
||||
case 'small':
|
||||
modalTypes = ['image', 'video', 'audio', 'flash']
|
||||
break
|
||||
default:
|
||||
modalTypes = this.mergedConfig.playVideosInModal
|
||||
? ['image', 'video', 'flash']
|
||||
: ['image']
|
||||
break
|
||||
}
|
||||
return modalTypes.includes(this.type)
|
||||
},
|
||||
...mapGetters(['mergedConfig'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue