diff options
Diffstat (limited to 'src/components/status_content')
| -rw-r--r-- | src/components/status_content/status_content.js | 27 | ||||
| -rw-r--r-- | src/components/status_content/status_content.vue | 33 |
2 files changed, 10 insertions, 50 deletions
diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js index 4d6f0a14..55f701d0 100644 --- a/src/components/status_content/status_content.js +++ b/src/components/status_content/status_content.js @@ -59,24 +59,6 @@ const StatusContent = { } return 'normal' }, - galleryTypes () { - if (this.attachmentSize === 'hide') { - return [] - } - return this.mergedConfig.playVideosInModal - ? ['image', 'video'] - : ['image'] - }, - galleryAttachments () { - return this.status.attachments.filter( - file => fileType.fileMatchesSomeType(this.galleryTypes, file) - ) - }, - nonGalleryAttachments () { - return this.status.attachments.filter( - file => !fileType.fileMatchesSomeType(this.galleryTypes, file) - ) - }, maxThumbnails () { return this.mergedConfig.maxThumbnails }, @@ -91,15 +73,6 @@ const StatusContent = { Gallery, LinkPreview, StatusBody - }, - methods: { - setHeadTailLinks (headTailLinks) { - this.$emit('parseReady', headTailLinks) - }, - setMedia () { - const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments - return () => this.$store.dispatch('setMedia', attachments) - } } } diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index 06edd780..c1533b19 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -9,35 +9,22 @@ :compact="compact" :single-line="singleLine" :hide-mentions="hideMentions" - @parseReady="setHeadTailLinks" + @parseReady="$emit('parseReady', $event)" > <div v-if="status.poll && status.poll.options"> <poll :base-poll="status.poll" /> </div> - <div - v-if="status.attachments.length !== 0" + <gallery class="attachments media-body" - > - <attachment - v-for="attachment in nonGalleryAttachments" - :key="attachment.id" - class="non-gallery" - :size="attachmentSize" - :nsfw="nsfwClickthrough" - :attachment="attachment" - :allow-play="true" - :set-media="setMedia()" - @play="$emit('mediaplay', attachment.id)" - @pause="$emit('mediapause', attachment.id)" - /> - <gallery - v-if="galleryAttachments.length > 0" - :nsfw="nsfwClickthrough" - :attachments="galleryAttachments" - :set-media="setMedia()" - /> - </div> + v-if="status.attachments.length !== 0" + :nsfw="nsfwClickthrough" + :attachments="status.attachments" + :size="attachmentSize" + @setMedia="onMedia" + @play="$emit('mediaplay', attachment.id)" + @pause="$emit('mediapause', attachment.id)" + /> <div v-if="status.card && !noHeading && !compact" |
