fix delete attachment on creation

stable
Juanfran 2016-08-11 14:02:29 +02:00
parent b2860e8a53
commit ca702689dc
2 changed files with 4 additions and 2 deletions

View File

@ -292,7 +292,8 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) ->
attachmentsToDelete = attachmentsToDelete.push(attachment)
if attachment.get("id")
attachmentsToDelete = attachmentsToDelete.push(attachment)
$scope.$on "usform:new", (ctx, projectId, status, statusList) ->
form.reset() if form

View File

@ -41,7 +41,8 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxSer
attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) ->
attachmentsToDelete = attachmentsToDelete.push(attachment)
if attachment.get("id")
attachmentsToDelete = attachmentsToDelete.push(attachment)
createAttachments = (obj) ->
promises = _.map attachmentsToAdd.toJS(), (attachment) ->