ninegitea/assets/js/dropzone.js
2023-12-22 13:53:10 +01:00

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;
});