From e0e1ee29e1bede2dbee6108c1a923663eecac9fd Mon Sep 17 00:00:00 2001 From: Pixelated Date: Wed, 23 Dec 2015 14:45:52 -0200 Subject: enable/disable send button when attachment is uploading Issue #548 --- web-ui/app/js/mail_view/ui/attachment.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'web-ui/app/js/mail_view/ui/attachment.js') diff --git a/web-ui/app/js/mail_view/ui/attachment.js b/web-ui/app/js/mail_view/ui/attachment.js index f57fea5b..fcb0fe68 100644 --- a/web-ui/app/js/mail_view/ui/attachment.js +++ b/web-ui/app/js/mail_view/ui/attachment.js @@ -42,13 +42,18 @@ define( dataType: 'json', done: function (e, response) { var data = response.result; - $('#files').html('' + data.filename + ' (' + humanReadable(data.filesize) + ')' + ''); + var link = '' + data.filename + ' (' + humanReadable(data.filesize) + ')' + ''; + $('#attachment-list-item').html(link); on.trigger(document, events.mail.uploadedAttachment, data); }, progressall: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .progress-bar').css('width', progress + '%'); } + }).bind('fileuploadstart', function(e) { + on.trigger(document, events.mail.uploadingAttachment); + }).bind('fileuploadadd', function(e) { + $('.attachmentsAreaWrap').show(); }); } @@ -60,6 +65,7 @@ define( this.after('initialize', function () { if (features.isEnabled('attachment')) { this.render(); + $('.attachmentsAreaWrap').hide(); } this.on(this.$node, 'click', this.upload); }); -- cgit v1.2.3