This commit is contained in:
Thomas Zilio 2020-06-30 13:25:21 +02:00
parent 5ab5ac2bf6
commit e71d4dcce2
1 changed files with 35 additions and 39 deletions

View File

@ -214,9 +214,10 @@ class FileManager implements ManagerInterface
Dropzone.autoDiscover = false;
$(document).ready(function() {
var dropzoneOptions = {
dictDefaultMessage: "'.tr('Clicca o trascina qui per caricare uno o più file.<br>(Max ulpload: '.$upload_max_filesize.' MB)').'",
var dragdrop = new Dropzone("#'.$attachment_id.' .dropzone", {
dictDefaultMessage: "'.tr('Clicca o trascina qui per caricare uno o più file').'.<br>('.tr('Max upload: _SIZE_', [
'_SIZE_' => $upload_max_filesize.' MB'
]).')",
paramName: "file",
maxFilesize: '.$upload_max_filesize.', // MB
uploadMultiple: false,
@ -229,25 +230,20 @@ $(document).ready(function() {
this.on("sending", function(file, xhr, formData) {
formData.append("categoria", $("#categoria").val());
formData.append("nome_allegato", $("#nome_allegato").val());
}),
this.on("success", function (file) {
//console.log("success > " + file.name);
dragdrop.removeFile(file);
}),
this.on("complete", function (file) {
});
this.on("success", function (file) {
dragdrop.removeFile(file);
});
this.on("complete", function (file) {
// Ricarico solo quando ho finito
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
reload_'.$attachment_id.'();
}
});
}
};
var dragdrop = new Dropzone("div#dragdrop", dropzoneOptions);
});
// Modifica categoria
$("#'.$attachment_id.' .category-edit").click(function() {