Newer
Older
import fileTypeService from '../../services/file_type/file_type.service.js'
const Attachment = {
props: [
'attachment',
data () {
return {
nsfwImage,
hideNsfwLocal: this.$store.state.config.hideNsfw,
showHidden: false,
loading: false,
img: document.createElement('img')
return this.nsfw && this.hideNsfwLocal && !this.showHidden

Shpuld Shpludson
committed
isEmpty () {
return (this.type === 'html' && !this.attachment.oembed) || this.type === 'unknown'
linkClicked ({target}) {
if (target.tagName === 'A') {
window.open(target.href, '_blank')
}
},
if (this.img.onload) {
this.img.onload()
} else {
this.loading = true
this.img.src = this.attachment.url
this.img.onload = () => {
this.loading = false
this.showHidden = !this.showHidden
}