diff --git a/app/modules/components/attachments-full/attachments-full.controller.coffee b/app/modules/components/attachments-full/attachments-full.controller.coffee index e2ae9361..5aa190d4 100644 --- a/app/modules/components/attachments-full/attachments-full.controller.coffee +++ b/app/modules/components/attachments-full/attachments-full.controller.coffee @@ -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") diff --git a/app/modules/components/attachments-full/attachments-full.jade b/app/modules/components/attachments-full/attachments-full.jade index 2e397046..13a81dd3 100644 --- a/app/modules/components/attachments-full/attachments-full.jade +++ b/app/modules/components/attachments-full/attachments-full.jade @@ -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}}