Rig up button to remove attachments
This commit is contained in:
parent
417d9bbd64
commit
62e7cf8933
2 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue