drag and drop attachments doesn't make it editable by default
parent
c588673752
commit
afaf10d515
|
@ -69,7 +69,7 @@ class AttachmentsFullController
|
||||||
@.deprecatedsVisible = !@.deprecatedsVisible
|
@.deprecatedsVisible = !@.deprecatedsVisible
|
||||||
@.generate()
|
@.generate()
|
||||||
|
|
||||||
addAttachment: (file) ->
|
addAttachment: (file, editable = true) ->
|
||||||
return new Promise (resolve, reject) =>
|
return new Promise (resolve, reject) =>
|
||||||
if @attachmentsService.validate(file)
|
if @attachmentsService.validate(file)
|
||||||
@.uploadingAttachments.push(file)
|
@.uploadingAttachments.push(file)
|
||||||
|
@ -84,7 +84,7 @@ class AttachmentsFullController
|
||||||
|
|
||||||
attachment = attachment.merge({
|
attachment = attachment.merge({
|
||||||
file: file,
|
file: file,
|
||||||
editable: true,
|
editable: editable,
|
||||||
loading: false
|
loading: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -95,8 +95,8 @@ class AttachmentsFullController
|
||||||
else
|
else
|
||||||
reject(file)
|
reject(file)
|
||||||
|
|
||||||
addAttachments: (files) ->
|
addAttachments: (files, editable) ->
|
||||||
_.forEach files, @.addAttachment.bind(this)
|
_.forEach files, (file) => @.addAttachment(file, editable)
|
||||||
|
|
||||||
deleteAttachment: (toDeleteAttachment) ->
|
deleteAttachment: (toDeleteAttachment) ->
|
||||||
title = @translate.instant("ATTACHMENT.TITLE_LIGHTBOX_DELETE_ATTACHMENT")
|
title = @translate.instant("ATTACHMENT.TITLE_LIGHTBOX_DELETE_ATTACHMENT")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
section.attachments(tg-attachments-drop="vm.addAttachments(files)")
|
section.attachments(tg-attachments-drop="vm.addAttachments(files, false)")
|
||||||
.attachments-header
|
.attachments-header
|
||||||
h3.attachments-title #[span.attachments-num {{vm.attachments.size}}] #[span.attachments-text(translate="ATTACHMENT.SECTION_NAME")]
|
h3.attachments-title #[span.attachments-num {{vm.attachments.size}}] #[span.attachments-text(translate="ATTACHMENT.SECTION_NAME")]
|
||||||
.options
|
.options
|
||||||
|
@ -32,7 +32,7 @@ section.attachments(tg-attachments-drop="vm.addAttachments(files)")
|
||||||
type="file",
|
type="file",
|
||||||
ng-model="files",
|
ng-model="files",
|
||||||
multiple="multiple",
|
multiple="multiple",
|
||||||
tg-file-change="vm.addAttachments(files)"
|
tg-file-change="vm.addAttachments(files, true)"
|
||||||
)
|
)
|
||||||
.attachments-empty(ng-if="!vm.attachments.size")
|
.attachments-empty(ng-if="!vm.attachments.size")
|
||||||
div {{'ATTACHMENT.DROP' | translate}}
|
div {{'ATTACHMENT.DROP' | translate}}
|
||||||
|
|
Loading…
Reference in New Issue