Skip to content

Commit

Permalink
Dropzone.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobmaker55 committed Sep 5, 2024
1 parent d14312f commit fbfc959
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 0 additions & 8 deletions conditional/templates/major_project_submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ <h3 class="page-title">Major Project Form</h3>
<div class="upload-sub">Drag files here or click to upload.</div>
</div>
</div>
<script>
Dropzone.options.projectFiles = {
// autoQueue:false,
parallelUploads: 2,
uploadMultiple: true,
acceptedFiles: "audio/*,photo/*,video/*,.pdf,.doc,.docx"
}
</script>
</div>
</div>
</div>
Expand Down
26 changes: 17 additions & 9 deletions frontend/javascript/modules/dropzone.js
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit fbfc959

Please sign in to comment.