diff options
author | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-02-04 11:35:53 +0100 |
---|---|---|
committer | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-02-04 11:35:53 +0100 |
commit | 97dbf261bd8ca9708673fc1c569b3b26ad8cf67c (patch) | |
tree | 425c6d92cd0a062f9ec67827446bec0a15a88a1a /web-ui/app/js/mail_view/ui | |
parent | 54932685e98f772041044f5a3181646e4f61a38f (diff) |
Issue #551 - Show attachment name during upload
Diffstat (limited to 'web-ui/app/js/mail_view/ui')
-rw-r--r-- | web-ui/app/js/mail_view/ui/attachment_list.js | 14 |
1 files changed, 10 insertions, 4 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 294a21a2..b3b26710 100644 --- a/web-ui/app/js/mail_view/ui/attachment_list.js +++ b/web-ui/app/js/mail_view/ui/attachment_list.js @@ -112,12 +112,18 @@ define( } }; - this.showUploadProgressBar = function() { + this.showUploadProgressBar = function(e, data) { + var element = $(templates.compose.attachmentUploadItem({ + name: data.originalFiles[0].name, + size: data.originalFiles[0].size + })); + this.select('attachmentUploadItem').append(element); this.select('attachmentUploadItem').show(); }; this.hideUploadProgressBar = function() { this.select('attachmentUploadItem').hide(); + this.select('attachmentUploadItem').empty(); }; this.attachUploadAbort = function(e, data) { @@ -139,7 +145,7 @@ define( this.select('inputFileUpload').fileupload({ add: function(e, data) { if (self.performPreUploadCheck(e, data)) { - self.showUploadProgressBar(); + self.showUploadProgressBar(e, data); self.attachUploadAbort(e, data); data.submit(); } else { @@ -149,13 +155,13 @@ define( url: self.attr.attachmentBaseUrl, dataType: 'json', done: function (e, response) { - self.hideUploadProgressBar(); self.detachUploadAbort(); + self.hideUploadProgressBar(); self.trigger(document, events.mail.uploadedAttachment, response.result); }, fail: function(e, data){ - self.hideUploadProgressBar(); self.detachUploadAbort(); + self.hideUploadProgressBar(); self.trigger(document, events.mail.failedUploadAttachment); }, progressall: function (e, data) { |