Reputation: 3854
I am working with Dropzone in a Laravel project. I have successfully implemented it but the remove icon is not appearing after I upload an image.
<div class="">
<div class="dropzone" id="dropzoneFileUpload"></div>
</div>
Dropzone.options.myAwesomeDropzone = {
paramName: "file",
addRemoveLinks: true,
maxFilesize: 5, // MB
init: function() {},
accept: function(file, done) {},
removedfile: function(file) {},
};
Upvotes: 1
Views: 2034
Reputation: 1795
after the addRemoveLinks add the following lines to the options
removedfile: function (file) {
var _ref;
return (_ref = file.previewElement) != null ? ref.parentNode.removeChild(file.previewElement) : void 0;
},
Upvotes: 1
Reputation: 684
I can't be sure but maybe Dropzone is already initialised when you set the addRemoveLinks option. Can you try to do it while initialising like this (in your domReady):
Dropzone.autoDiscover = false;
var myDropzone = new Dropzone('#dropzoneFileUpload', {
paramName: "file",
addRemoveLinks: true,
maxFilesize: 5, // MB
init: function() {},
accept: function(file, done) {},
removedfile: function(file) {}
}
Upvotes: 1