fix issue #4969 remove attachments from lightbox creation

stable
Juanfran 2017-03-09 15:42:12 +01:00
parent b51f6ede7c
commit 423821f071
4 changed files with 11 additions and 0 deletions

View File

@ -315,6 +315,9 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
attachmentsToAdd = attachmentsToAdd.push(attachment) attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) -> $scope.deleteAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.filter (it) ->
return it.get('name') != attachment.get('name')
if attachment.get("id") if attachment.get("id")
attachmentsToDelete = attachmentsToDelete.push(attachment) attachmentsToDelete = attachmentsToDelete.push(attachment)

View File

@ -78,6 +78,10 @@ CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading,
$scope.addAttachment = (attachment) -> $scope.addAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.push(attachment) attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.filter (it) ->
return it.get('name') != attachment.get('name')
$scope.addTag = (tag, color) -> $scope.addTag = (tag, color) ->
value = trim(tag.toLowerCase()) value = trim(tag.toLowerCase())

View File

@ -42,6 +42,9 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxSer
attachmentsToAdd = attachmentsToAdd.push(attachment) attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) -> $scope.deleteAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.filter (it) ->
return it.get('name') != attachment.get('name')
if attachment.get("id") if attachment.get("id")
attachmentsToDelete = attachmentsToDelete.push(attachment) attachmentsToDelete = attachmentsToDelete.push(attachment)

View File

@ -43,6 +43,7 @@ form
tg-attachments-simple( tg-attachments-simple(
attachments="attachments", attachments="attachments",
on-add="addAttachment(attachment)" on-add="addAttachment(attachment)"
on-delete="deleteAttachment(attachment)"
) )
fieldset fieldset