From e3939d4c1dff0f152fa13ce8a89f751c79ecace2 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Mon, 1 Feb 2016 17:50:06 -0200 Subject: Issue #549 - Implemented UI part of remote attachments --- web-ui/app/js/mail_view/ui/forward_box.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'web-ui/app/js/mail_view/ui/forward_box.js') 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(); -- cgit v1.2.3