drag and drop attachments doesn't make it editable by default

stable
Juanfran 2016-01-19 14:35:51 +01:00
parent c588673752
commit afaf10d515
2 changed files with 6 additions and 6 deletions

View File

@ -69,7 +69,7 @@ class AttachmentsFullController
@.deprecatedsVisible = !@.deprecatedsVisible
@.generate()
addAttachment: (file) ->
addAttachment: (file, editable = true) ->
return new Promise (resolve, reject) =>
if @attachmentsService.validate(file)
@.uploadingAttachments.push(file)
@ -84,7 +84,7 @@ class AttachmentsFullController
attachment = attachment.merge({
file: file,
editable: true,
editable: editable,
loading: false
})
@ -95,8 +95,8 @@ class AttachmentsFullController
else
reject(file)
addAttachments: (files) ->
_.forEach files, @.addAttachment.bind(this)
addAttachments: (files, editable) ->
_.forEach files, (file) => @.addAttachment(file, editable)
deleteAttachment: (toDeleteAttachment) ->
title = @translate.instant("ATTACHMENT.TITLE_LIGHTBOX_DELETE_ATTACHMENT")

View File

@ -1,4 +1,4 @@
section.attachments(tg-attachments-drop="vm.addAttachments(files)")
section.attachments(tg-attachments-drop="vm.addAttachments(files, false)")
.attachments-header
h3.attachments-title #[span.attachments-num {{vm.attachments.size}}] #[span.attachments-text(translate="ATTACHMENT.SECTION_NAME")]
.options
@ -32,7 +32,7 @@ section.attachments(tg-attachments-drop="vm.addAttachments(files)")
type="file",
ng-model="files",
multiple="multiple",
tg-file-change="vm.addAttachments(files)"
tg-file-change="vm.addAttachments(files, true)"
)
.attachments-empty(ng-if="!vm.attachments.size")
div {{'ATTACHMENT.DROP' | translate}}