21 lines
628 B
JavaScript
21 lines
628 B
JavaScript
|
|
require('dropzone/dist/dropzone.css');
|
|
const { Dropzone } = require("dropzone");
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
var elt = document.getElementById('mydropzone');
|
|
maxFiles=elt.getAttribute("data-maxFiles");
|
|
if(maxFiles!=1) maxFiles=null;
|
|
|
|
var mydropzone = new Dropzone(elt, {
|
|
acceptedMimeTypes: $(elt).data("acceptedMimeTypes"),
|
|
maxFiles: maxFiles,
|
|
init: function() {
|
|
dropzoneinit(this);
|
|
},
|
|
success: function( file, response ){
|
|
dropzonesuccess(file,response);
|
|
},
|
|
});
|
|
window.mydropzone=mydropzone;
|
|
}); |