From 8bd829962f5879f7994b787199779465afa81a7c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 29 Oct 2020 17:38:06 -0400 Subject: attachments.js: discard unused drag events --- themes/alps/assets/attachments.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'themes') 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"); -- cgit v1.2.3