Browse Source

fix Dropzone.js integration (#7445) (#7448)

tags/v1.9.0-rc2
silverwind 5 years ago
parent
commit
cc8e7dd355
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      public/js/index.js

+ 7
- 6
public/js/index.js View File

var csrf; var csrf;
var suburl; 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) // Polyfill for IE9+ support (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
if (!Array.from) { if (!Array.from) {
Array.from = (function () { Array.from = (function () {
} }


// Dropzone // Dropzone
var $dropzone = $('#dropzone');
const $dropzone = $('#dropzone');
if ($dropzone.length > 0) { 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'), url: $dropzone.data('upload-url'),
headers: {"X-Csrf-Token": csrf}, headers: {"X-Csrf-Token": csrf},
maxFiles: $dropzone.data('max-file'), maxFiles: $dropzone.data('max-file'),
}); });
} }
}) })
}
},
}); });
} }



Loading…
Cancel
Save