diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-10-29 17:38:06 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-10-29 17:38:06 -0400 |
commit | 8bd829962f5879f7994b787199779465afa81a7c (patch) | |
tree | 53d6eeb0b4f43921d4339983572b16f5df8f960f /themes | |
parent | 26e6e66b04059b1063f03779f962e5bb6ead4b7d (diff) | |
download | alps-8bd829962f5879f7994b787199779465afa81a7c.tar.gz alps-8bd829962f5879f7994b787199779465afa81a7c.zip |
attachments.js: discard unused drag events
Diffstat (limited to 'themes')
-rw-r--r-- | themes/alps/assets/attachments.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/themes/alps/assets/attachments.js b/themes/alps/assets/attachments.js index 1f02ab5..e519c29 100644 --- a/themes/alps/assets/attachments.js +++ b/themes/alps/assets/attachments.js @@ -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"); |