issue #1 - better nsfw image loading
preload the image when it is toggled, but wait to replace it until it has loaded.
This commit is contained in:
parent
6075915223
commit
9107facaca
2 changed files with 6 additions and 1 deletions
|
@ -29,7 +29,11 @@ const Attachment = {
|
|||
}
|
||||
},
|
||||
toggleHidden () {
|
||||
this.showHidden = !this.showHidden
|
||||
let img = document.createElement('img')
|
||||
img.src = this.attachment.url
|
||||
img.onload = () => {
|
||||
this.showHidden = !this.showHidden
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue