diff options
author | NavaL <ayoyo@thoughtworks.com> | 2016-02-12 14:53:27 -0200 |
---|---|---|
committer | NavaL <ayoyo@thoughtworks.com> | 2016-02-12 14:53:27 -0200 |
commit | 78925e0332bbc41ed37e27d506be192abdb7124e (patch) | |
tree | f761d0ff19afebb6e219219179a1045f03c16196 /web-ui/app/js/mail_view/ui/forward_box.js | |
parent | f0145903a188a6eead1d07b188603488fd5af1e6 (diff) |
Revert "Revert "Issue #549 - Implemented UI part of remote attachments""
This reverts commit 48144118cf0e861ad1ca0ae7900a8cd12d4313db.
Diffstat (limited to 'web-ui/app/js/mail_view/ui/forward_box.js')
-rw-r--r-- | web-ui/app/js/mail_view/ui/forward_box.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/web-ui/app/js/mail_view/ui/forward_box.js b/web-ui/app/js/mail_view/ui/forward_box.js index a1b8dc41..3d643b2f 100644 --- a/web-ui/app/js/mail_view/ui/forward_box.js +++ b/web-ui/app/js/mail_view/ui/forward_box.js @@ -46,14 +46,29 @@ define( subject: this.attr.subject, recipients: { to: [], cc: []}, body: viewHelper.quoteMail(mail), - attachments: mail.attachments + attachments: this.convertToRemovableAttachments(mail.attachments) }); + var self = this; + this.$node.find('i.remove-icon').bind('click', function(event) { + var element = $(this); + var ident = element.closest('li').attr('data-ident'); + self.trigger(document, events.mail.removeAttachment, {ident: ident}); + event.preventDefault(); + }); + this.on(this.select('subjectDisplay'), 'click', this.showSubjectInput); this.select('recipientsDisplay').hide(); this.select('recipientsFields').show(); }; + this.convertToRemovableAttachments = function(attachments) { + return attachments.map(function(attachment) { + attachment.removable = true; + return attachment; + }); + }; + this.showSubjectInput = function() { this.select('subjectDisplay').hide(); this.select('subjectInput').show(); |