Skip to content

Commit 4152ead

Browse files
committed
fix Dropzone.js integration
1 parent 2a1ec31 commit 4152ead

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

public/js/index.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ function htmlEncode(text) {
1010
var csrf;
1111
var suburl;
1212

13+
// Disable Dropzone auto-discover because it's manually initialized
14+
Dropzone.autoDiscover = false;
15+
1316
// Polyfill for IE9+ support (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
1417
if (!Array.from) {
1518
Array.from = (function () {
@@ -2005,13 +2008,11 @@ $(document).ready(function () {
20052008
}
20062009

20072010
// Dropzone
2008-
var $dropzone = $('#dropzone');
2011+
const $dropzone = $('#dropzone');
20092012
if ($dropzone.length > 0) {
2010-
// Disable auto discover for all elements:
2011-
Dropzone.autoDiscover = false;
2013+
const filenameDict = {};
20122014

2013-
var filenameDict = {};
2014-
$dropzone.dropzone({
2015+
new Dropzone("#dropzone", {
20152016
url: $dropzone.data('upload-url'),
20162017
headers: {"X-Csrf-Token": csrf},
20172018
maxFiles: $dropzone.data('max-file'),
@@ -2039,7 +2040,7 @@ $(document).ready(function () {
20392040
});
20402041
}
20412042
})
2042-
}
2043+
},
20432044
});
20442045
}
20452046

0 commit comments

Comments
 (0)