(js) Fix uploading same attachment after removal

Fixes #3876
This commit is contained in:
Francis Lachapelle
2016-11-10 10:21:33 -05:00
parent a78621add4
commit 5961117208
2 changed files with 9 additions and 4 deletions
@@ -134,13 +134,18 @@
}
}
function removeAttachment(item) {
function removeAttachment(item, id) {
if (item.isUploading)
vm.uploader.cancelItem(item);
else {
vm.message.$deleteAttachment(item.file.name);
item.remove();
}
// Hack to allow adding the same file again
// See https://github.com/nervgh/angular-file-upload/issues/671
var element = $window.document.getElementById(id);
if (element)
angular.element(element).prop('value', null);
}
function cancel() {