From fbfc95947a63277522a7b0dc79d85bdb727c739f Mon Sep 17 00:00:00 2001 From: Mobmaker <45888585+Mobmaker55@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:46:24 -0400 Subject: [PATCH] Dropzone.js --- .../templates/major_project_submission.html | 8 ------ frontend/javascript/modules/dropzone.js | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/conditional/templates/major_project_submission.html b/conditional/templates/major_project_submission.html index a1a4ba9e..90e38fff 100644 --- a/conditional/templates/major_project_submission.html +++ b/conditional/templates/major_project_submission.html @@ -58,14 +58,6 @@

Major Project Form

Drag files here or click to upload.
- diff --git a/frontend/javascript/modules/dropzone.js b/frontend/javascript/modules/dropzone.js index 2b04a87e..d9da7c50 100644 --- a/frontend/javascript/modules/dropzone.js +++ b/frontend/javascript/modules/dropzone.js @@ -1,18 +1,26 @@ import Dropzone from "dropzone"; + Dropzone.autoDiscover = false; export default class DropzoneUpload { - constructor(element) { - this.element = element; - this.render(); - } + constructor(element) { + this.element = element; + this.render(); + } - render() { - const dz = new Dropzone(this.element); // eslint-disable-line new-cap - dz.on("complete", () => window.location.reload()); - } + render() { + const dz = new Dropzone(this.element); // eslint-disable-line new-cap + dz.on("complete", () => window.location.reload()); + } } Dropzone.options.uploadUser = { - acceptedFiles: ".csv" + acceptedFiles: ".csv" }; + +Dropzone.options.projectFiles = { + // autoQueue:false, + parallelUploads: 2, + uploadMultiple: true, + acceptedFiles: "audio/*,photo/*,video/*,.pdf,.doc,.docx" +}