uploads: fix dropzone widget to allow replacing files.

This commit is contained in:
evazion
2019-09-22 21:08:10 -05:00
parent 22d4625071
commit 5a7b3d812e

View File

@@ -154,6 +154,13 @@
$("#filedropzone .dz-progress").hide();
});
this.on("addedfile", function(file) {
// replace the previous file with this one.
Danbooru.Upload.dropzone.files.forEach(f => {
if (f !== file) {
Danbooru.Upload.dropzone.removeFile(f);
}
});
var reader = new FileReader();
reader.addEventListener("loadend", function() {
var buf = new Danbooru.SparkMD5.ArrayBuffer();