Skip to content

Commit

Permalink
Fixes issue removing existing uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Nov 27, 2015
1 parent b6ba31b commit 6ebe187
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/backend/formwidgets/fileupload/assets/js/fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
}

Expand Down

0 comments on commit 6ebe187

Please sign in to comment.