diff options
author | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-02-08 17:59:42 +0100 |
---|---|---|
committer | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-02-08 18:10:53 +0100 |
commit | 48144118cf0e861ad1ca0ae7900a8cd12d4313db (patch) | |
tree | bdb4639d1f18b2975be5953055f4d190b7ba167e | |
parent | 3c6b905d7e5b78e521b2e7692e5e32b7b0c226bc (diff) |
Revert "Issue #549 - Implemented UI part of remote attachments"
This reverts commit e3939d4c1dff0f152fa13ce8a89f751c79ecace2.
-rw-r--r-- | web-ui/app/js/mail_view/ui/attachment_list.js | 16 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/draft_box.js | 17 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/forward_box.js | 17 | ||||
-rw-r--r-- | web-ui/app/js/page/events.js | 3 | ||||
-rw-r--r-- | web-ui/app/scss/_read.scss | 15 | ||||
-rw-r--r-- | web-ui/app/templates/compose/attachment_item.hbs | 5 | ||||
-rw-r--r-- | web-ui/app/templates/compose/attachments_list.hbs | 1 |
7 files changed, 13 insertions, 61 deletions
diff --git a/web-ui/app/js/mail_view/ui/attachment_list.js b/web-ui/app/js/mail_view/ui/attachment_list.js index b3b26710..942148c1 100644 --- a/web-ui/app/js/mail_view/ui/attachment_list.js +++ b/web-ui/app/js/mail_view/ui/attachment_list.js @@ -55,25 +55,15 @@ define( this.renderAttachmentListView = function (data) { var currentHtml = this.select('attachmentListItem').html(); var item = this.buildAttachmentListItem(data); - this.select('attachmentListItem').append(item); + this.select('attachmentListItem').html(currentHtml + item); }; this.buildAttachmentListItem = function (attachment) { var attachmentData = {ident: attachment.ident, encoding: attachment.encoding, name: attachment.name, - size: attachment.size, - removable: true}; - - var element = $(templates.compose.attachmentItem(attachmentData)); - var self = this; - element.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(); - }); - return element; + size: attachment.size}; + return templates.compose.attachmentItem(attachmentData); }; this.performPreUploadCheck = function(e, data) { diff --git a/web-ui/app/js/mail_view/ui/draft_box.js b/web-ui/app/js/mail_view/ui/draft_box.js index 07a7e472..88051f30 100644 --- a/web-ui/app/js/mail_view/ui/draft_box.js +++ b/web-ui/app/js/mail_view/ui/draft_box.js @@ -64,15 +64,7 @@ define( }, subject: mail.header.subject, body: body, - 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(); + attachments: mail.attachments }); this.enableFloatlabel('input.floatlabel'); @@ -85,13 +77,6 @@ define( this.on(this.select('closeMailButton'), 'click', this.showNoMessageSelected); }; - this.convertToRemovableAttachments = function(attachments) { - return attachments.map(function(attachment) { - attachment.removable = true; - return attachment; - }); - }; - this.mailDeleted = function(event, data) { if (_.contains(_.pluck(data.mails, 'ident'), this.attr.ident)) { this.trigger(events.dispatchers.rightPane.openNoMessageSelected); 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 3d643b2f..a1b8dc41 100644 --- a/web-ui/app/js/mail_view/ui/forward_box.js +++ b/web-ui/app/js/mail_view/ui/forward_box.js @@ -46,29 +46,14 @@ define( subject: this.attr.subject, recipients: { to: [], cc: []}, body: viewHelper.quoteMail(mail), - attachments: this.convertToRemovableAttachments(mail.attachments) + attachments: 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(); diff --git a/web-ui/app/js/page/events.js b/web-ui/app/js/page/events.js index 1ec27c46..b1073437 100644 --- a/web-ui/app/js/page/events.js +++ b/web-ui/app/js/page/events.js @@ -148,8 +148,7 @@ define(function () { startUploadAttachment: 'mail:start:upload:attachment', failedUploadAttachment: 'mail:failed:upload:attachment', appendAttachment: 'mail:append:attachment', - resetAttachments: 'mail:reset:attachments', - removeAttachment: 'mail:remove:attachment' + resetAttachments: 'mail:reset:attachments' }, mails: { available: 'mails:available', diff --git a/web-ui/app/scss/_read.scss b/web-ui/app/scss/_read.scss index 4a11ca76..d98e10a7 100644 --- a/web-ui/app/scss/_read.scss +++ b/web-ui/app/scss/_read.scss @@ -31,7 +31,7 @@ height: 27px; margin-right: 3px; } - + .full-view-header { display:inline-block; padding-top: 5px; @@ -82,14 +82,14 @@ border-radius: 2px; background-color: #F5F5F5; margin-bottom: 8px; - + a { color: $attachment_text; display: block; text-decoration: none; line-height: inherit; padding: 4px 5px; - + &:hover, &:focus { i.download-icon { color: lighten($attachment_icon, 15); @@ -105,13 +105,6 @@ right: 0; padding: 7px 10px; } - - i.remove-icon { - float: right; - padding-right: 5px; - padding-top: 7px; - color: #999; - } } } } @@ -162,3 +155,5 @@ } } } + + diff --git a/web-ui/app/templates/compose/attachment_item.hbs b/web-ui/app/templates/compose/attachment_item.hbs index 6fefda2f..a69f209e 100644 --- a/web-ui/app/templates/compose/attachment_item.hbs +++ b/web-ui/app/templates/compose/attachment_item.hbs @@ -1,11 +1,8 @@ -<li data-ident="{{ this.ident }}"> +<li> <a href="/attachment/{{ this.ident }}?encoding={{ this.encoding }}&filename={{ this.name }}"> {{ this.name }} <span class="attachment-size">({{ formatSize this.size}})</span> {{#if received}} <i class="fa fa-arrow-down download-icon"></i> {{/if}} - {{#if removable}} - <i class="fa fa-close remove-icon"></i> - {{/if}} </a> </li> diff --git a/web-ui/app/templates/compose/attachments_list.hbs b/web-ui/app/templates/compose/attachments_list.hbs index 4d3f1cac..e6e45cf3 100644 --- a/web-ui/app/templates/compose/attachments_list.hbs +++ b/web-ui/app/templates/compose/attachments_list.hbs @@ -18,3 +18,4 @@ <br> </div> + |