ninegitea/assets/js/dropzone.js

21 lines
628 B
JavaScript
Raw Permalink Normal View History

2023-12-22 13:53:10 +01:00
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;
});