initial commit
This commit is contained in:
29
public/dropzone/dropzone-config.js
vendored
Normal file
29
public/dropzone/dropzone-config.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
var total_photos_counter = 0;
|
||||
Dropzone.options.myDropzone = {
|
||||
uploadMultiple: true,
|
||||
parallelUploads: 2,
|
||||
maxFilesize: 16,
|
||||
previewTemplate: document.querySelector('#preview').innerHTML,
|
||||
addRemoveLinks: true,
|
||||
dictRemoveFile: 'Remove file',
|
||||
dictFileTooBig: 'Image is larger than 16MB',
|
||||
timeout: 10000,
|
||||
|
||||
init: function () {
|
||||
this.on("removedfile", function (file) {
|
||||
$.post({
|
||||
url: '/thpcustomer/images-delete',
|
||||
data: {id: file.name, _token: $('[name="_token"]').val()},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
total_photos_counter--;
|
||||
$("#counter").text("# " + total_photos_counter);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
success: function (file, done) {
|
||||
total_photos_counter++;
|
||||
$("#counter").text("# " + total_photos_counter);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user