aboutsummaryrefslogtreecommitdiff
path: root/src/components/attachment/attachment.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-06-18 14:12:50 +0300
committerHenry Jameson <me@hjkos.com>2021-06-18 14:12:50 +0300
commitbfe31e20eaddaa9435c98962c53c35f4184ed5fe (patch)
tree4a1c4db5520dd819b0ea68ede474cea4fab833b2 /src/components/attachment/attachment.js
parent5c2744b426203ac0108fb6f736718b003c6f8cd9 (diff)
better compact attachments
Diffstat (limited to 'src/components/attachment/attachment.js')
-rw-r--r--src/components/attachment/attachment.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index a80c5c2e..84656ffa 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -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'])