I've created a dropzone showing existing files on the server. I've added remove links which work. My problem is that when I remove a file with its remove link, the default "Drop files here to upload" message appears in the dropzone even though there are still thumbnails remaining.
I've followed this tutorial and updated with
myDropzone.emit("addedfile", mockFile);
// And optionally show the thumbnail of the file:
myDropzone.emit("thumbnail", mockFile, "/image/url");
// Make sure that there is no progress bar, etc...
myDropzone.emit("complete", mockFile);
from Enyo's FAQ.
Why would this be happening?
On a dropzone with no existing files, this message only appears when the last file is removed.
All help appreciated.
Cheers,
Tane
Ok I've figured it out, no need to add code to manually change class names. Just add this when you're adding your mockfiles.
mydropzone.files.push(mockFile);
This files array is what dropzone is using to determine if the dropzone is empty or not. And when I was just changing the length property, code was crashing trying to access an array that was never filled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With