summaryrefslogtreecommitdiff
path: root/static/script.js
diff options
context:
space:
mode:
authorGravatar steering72532026-06-24 10:14:22 +0000
committerGravatar steering72532026-06-24 10:14:22 +0000
commitbcebd79cb3d24598dd8da4b78670a6d4d54e2e6e (patch)
tree4cb104bbf9e4b5e1dd139dcdb24ee71e0ab3591b /static/script.js
parentfix curl uploads - allow PUT as well (diff)
allow to drop anywhere
Diffstat (limited to 'static/script.js')
-rw-r--r--static/script.js17
1 files changed, 2 insertions, 15 deletions
diff --git a/static/script.js b/static/script.js
index 5d48603..4be36b8 100644
--- a/static/script.js
+++ b/static/script.js
@@ -28,7 +28,6 @@ addEventListener("DOMContentLoaded", function () {
}
/* DRAG-N-DROP */
- const dropZone = document.getElementById("drop-zone");
const preview = document.getElementById("preview");
function dropHandler(ev) {
@@ -39,9 +38,9 @@ addEventListener("DOMContentLoaded", function () {
uploadFiles(files);
}
- dropZone.addEventListener("drop", dropHandler);
+ window.addEventListener("drop", dropHandler);
- dropZone.addEventListener("dragover", (e) => {
+ window.addEventListener("dragover", (e) => {
const fileItems = [...e.dataTransfer.items].filter(
(item) => item.kind === "file",
);
@@ -55,18 +54,6 @@ addEventListener("DOMContentLoaded", function () {
}
});
- window.addEventListener("dragover", (e) => {
- const fileItems = [...e.dataTransfer.items].filter(
- (item) => item.kind === "file",
- );
- if (fileItems.length > 0) {
- e.preventDefault();
- if (!dropZone.contains(e.target)) {
- e.dataTransfer.dropEffect = "none";
- }
- }
- });
-
const fileInput = document.getElementById("file-input");
fileInput.addEventListener("change", (e) => {
uploadFiles(e.target.files);