added pointer cursor for nsfw placeholder. fixed nsfw videos requiring double-click
This commit is contained in:
parent
87eee191b8
commit
d2ec70c323
2 changed files with 18 additions and 10 deletions
|
@ -15,7 +15,7 @@ const Attachment = {
|
|||
hideNsfwLocal: this.$store.state.config.hideNsfw,
|
||||
showHidden: false,
|
||||
loading: false,
|
||||
img: document.createElement('img')
|
||||
img: this.type === 'image' && document.createElement('img')
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -45,15 +45,19 @@ const Attachment = {
|
|||
}
|
||||
},
|
||||
toggleHidden () {
|
||||
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
|
||||
if (this.img) {
|
||||
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
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.showHidden = !this.showHidden
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue