Skip to content

Commit

Permalink
fix Dropzone.js integration (#7445) (#7448)
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind authored and zeripath committed Jul 12, 2019
1 parent f528406 commit cc8e7dd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ function htmlEncode(text) {
var csrf;
var suburl;

// Disable Dropzone auto-discover because it's manually initialized
Dropzone.autoDiscover = false;

// Polyfill for IE9+ support (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
if (!Array.from) {
Array.from = (function () {
Expand Down Expand Up @@ -1972,13 +1975,11 @@ $(document).ready(function () {
}

// Dropzone
var $dropzone = $('#dropzone');
const $dropzone = $('#dropzone');
if ($dropzone.length > 0) {
// Disable auto discover for all elements:
Dropzone.autoDiscover = false;
const filenameDict = {};

var filenameDict = {};
$dropzone.dropzone({
new Dropzone("#dropzone", {
url: $dropzone.data('upload-url'),
headers: {"X-Csrf-Token": csrf},
maxFiles: $dropzone.data('max-file'),
Expand Down Expand Up @@ -2006,7 +2007,7 @@ $(document).ready(function () {
});
}
})
}
},
});
}

Expand Down

0 comments on commit cc8e7dd

Please sign in to comment.