diff options
| author | Hakaba Hitoyo <example@example.com> | 2018-04-22 00:48:06 +0900 |
|---|---|---|
| committer | Hakaba Hitoyo <example@example.com> | 2018-04-22 00:48:06 +0900 |
| commit | 033170212f59ee2e0757fcc0264f64a15e638f64 (patch) | |
| tree | bc592c1d90070e2d6b8854556bdc2f710b670fae /src/components/attachment/attachment.js | |
| parent | ef67bd693e9ee0cb42b4ebd0b10f68e63ba04750 (diff) | |
| parent | b6eb1b1d98c839f5340edd3d3c4764952f2cb189 (diff) | |
merge
Diffstat (limited to 'src/components/attachment/attachment.js')
| -rw-r--r-- | src/components/attachment/attachment.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 8a2a3826..d9bc4477 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -1,3 +1,4 @@ +import StillImage from '../still-image/still-image.vue' import nsfwImage from '../../assets/nsfw.png' import fileTypeService from '../../services/file_type/file_type.service.js' @@ -5,7 +6,8 @@ const Attachment = { props: [ 'attachment', 'nsfw', - 'statusId' + 'statusId', + 'size' ], data () { return { @@ -16,6 +18,9 @@ const Attachment = { img: document.createElement('img') } }, + components: { + StillImage + }, computed: { type () { return fileTypeService.fileType(this.attachment.mimetype) @@ -25,6 +30,12 @@ const Attachment = { }, isEmpty () { return (this.type === 'html' && !this.attachment.oembed) || this.type === 'unknown' + }, + isSmall () { + return this.size === 'small' + }, + fullwidth () { + return fileTypeService.fileType(this.attachment.mimetype) === 'html' } }, methods: { |
