Allow preview of thread images
This commit is contained in:
parent
e43b08dc64
commit
0ff2884429
5 changed files with 95 additions and 38 deletions
|
|
@ -1419,24 +1419,7 @@ export default {
|
|||
},
|
||||
|
||||
download(event) {
|
||||
util
|
||||
.getAttachment(this.$matrix.matrixClient, event)
|
||||
.then((url) => {
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.target = "_blank";
|
||||
link.download = event.getContent().body || this.$t("fallbacks.download_name");
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
setTimeout(function () {
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(url);
|
||||
}, 200);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("Failed to fetch attachment: ", err);
|
||||
});
|
||||
util.download(this.$matrix.matrixClient, event);
|
||||
},
|
||||
|
||||
cancelEditReply() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue