nineskeletor/assets/dropzone.js

21 lines
628 B
JavaScript
Raw Normal View History

2022-07-21 16:15:47 +02:00
require('dropzone/dist/dropzone.css');
const { Dropzone } = require("dropzone");
document.addEventListener('DOMContentLoaded', function() {
var elt = document.getElementById('mydropzone');
2023-02-01 09:03:27 +01:00
maxFiles=elt.getAttribute("data-maxFiles");
if(maxFiles!=1) maxFiles=null;
2022-07-21 16:15:47 +02:00
var mydropzone = new Dropzone(elt, {
acceptedMimeTypes: $(elt).data("acceptedMimeTypes"),
2023-02-01 09:03:27 +01:00
maxFiles: maxFiles,
init: function() {
dropzoneinit(this);
},
2022-07-21 16:15:47 +02:00
success: function( file, response ){
dropzonesuccess(file,response);
},
});
2023-02-01 09:03:27 +01:00
window.mydropzone=mydropzone;
2022-07-21 16:15:47 +02:00
});