Fixes issue removing existing uploads

This commit is contained in:
Samuel Georges 2015-11-28 09:24:20 +11:00
parent b6ba31bd86
commit 6ebe187db1
1 changed files with 10 additions and 1 deletions

View File

@ -195,8 +195,17 @@
FileUpload.prototype.removeFileFromElement = function($element) {
var self = this
$element.each(function() {
self.dropzone.removeFile($(this).data('dzFileObject'))
var $el = $(this),
obj = $el.data('dzFileObject')
if (obj) {
self.dropzone.removeFile(obj)
}
else {
$el.remove()
}
})
}