Skip to content

Commit cc8e7dd

Browse files
silverwindzeripath
authored andcommitted
fix Dropzone.js integration (#7445) (#7448)
1 parent f528406 commit cc8e7dd

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 () {
@@ -1972,13 +1975,11 @@ $(document).ready(function () {
19721975
}
19731976

19741977
// Dropzone
1975-
var $dropzone = $('#dropzone');
1978+
const $dropzone = $('#dropzone');
19761979
if ($dropzone.length > 0) {
1977-
// Disable auto discover for all elements:
1978-
Dropzone.autoDiscover = false;
1980+
const filenameDict = {};
19791981

1980-
var filenameDict = {};
1981-
$dropzone.dropzone({
1982+
new Dropzone("#dropzone", {
19821983
url: $dropzone.data('upload-url'),
19831984
headers: {"X-Csrf-Token": csrf},
19841985
maxFiles: $dropzone.data('max-file'),
@@ -2006,7 +2007,7 @@ $(document).ready(function () {
20062007
});
20072008
}
20082009
})
2009-
}
2010+
},
20102011
});
20112012
}
20122013

0 commit comments

Comments
 (0)