diff options
author | Jefferson Stachelski <jstachel@thoughtworks.com> | 2016-02-01 17:50:06 -0200 |
---|---|---|
committer | Jefferson Stachelski <jstachel@thoughtworks.com> | 2016-02-01 17:50:47 -0200 |
commit | e3939d4c1dff0f152fa13ce8a89f751c79ecace2 (patch) | |
tree | 67bfc6d9024a271ece8b306101304a01f1f96962 /web-ui/app/js/mail_view/ui/forward_box.js | |
parent | c7c8607665de3fbe7238436c6b6b240673549aec (diff) |
Issue #549 - Implemented UI part of remote attachments
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(); |