Rig up button to remove attachments

This commit is contained in:
Drew DeVault 2020-10-30 13:50:43 -04:00
parent 417d9bbd64
commit 62e7cf8933
2 changed files with 7 additions and 0 deletions

View file

@ -75,6 +75,12 @@ function attachFile(file) {
};
attachments.push(attachment);
attachmentsNode.appendChild(node);
node.querySelector("button").addEventListener("click", ev => {
attachment.xhr.abort();
attachments = attachments.filter(a => a !== attachment);
node.remove();
updateState();
});
let formData = new FormData();
formData.append("attachments", file);

View file

@ -234,6 +234,7 @@ main.create-update #attachment-list .upload .filename {
main.create-update #attachment-list .upload button {
padding: inherit;
min-width: inherit;
}
main.create-update #attachment-list .upload .progress {