attachments.js: discard unused drag events
This commit is contained in:
parent
26e6e66b04
commit
8bd829962f
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,10 @@ attachmentsInput.addEventListener("input", ev => {
|
|||
}
|
||||
});
|
||||
|
||||
window.addEventListener("dragenter", dragNOP);
|
||||
window.addEventListener("dragleave", dragNOP);
|
||||
window.addEventListener("dragover", dragNOP);
|
||||
|
||||
window.addEventListener("drop", ev => {
|
||||
ev.preventDefault();
|
||||
const files = ev.dataTransfer.files;
|
||||
|
@ -24,6 +28,11 @@ window.addEventListener("drop", ev => {
|
|||
}
|
||||
});
|
||||
|
||||
function dragNOP(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
const sendButton = document.getElementById("send-button"),
|
||||
saveButton = document.getElementById("save-button");
|
||||
|
||||
|
|
Loading…
Reference in a new issue