diff options
Diffstat (limited to 'web-ui/app/js/mail_view/ui/send_button.js')
-rw-r--r-- | web-ui/app/js/mail_view/ui/send_button.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/web-ui/app/js/mail_view/ui/send_button.js b/web-ui/app/js/mail_view/ui/send_button.js index 5c1c3506..b16ea055 100644 --- a/web-ui/app/js/mail_view/ui/send_button.js +++ b/web-ui/app/js/mail_view/ui/send_button.js @@ -47,7 +47,7 @@ define([ this.updateButton = function () { if (this.attr.sendingInProgress === false) { - if (this.atLeastOneInputFieldHasCharacters() || this.atLeastOneInputFieldHasRecipients()) { + if (this.attr.uploading === false && (this.atLeastOneInputFieldHasCharacters() || this.atLeastOneInputFieldHasRecipients())) { this.enableButton(); } else { this.disableButton(); @@ -65,6 +65,16 @@ define([ this.updateButton(); }; + this.uploadInProgress = function (ev, data) { + this.attr.uploading = true; + this.updateButton(); + }; + + this.uploadFinished = function (ev, data) { + this.attr.uploading = false; + this.updateButton(); + }; + this.updateRecipientsForField = function (ev, data) { this.attr.recipients[data.recipientsName] = data.newRecipients; this.attr.inputFieldHasCharacters[data.recipientsName] = false; @@ -89,6 +99,7 @@ define([ this.resetButton = function () { this.attr.sendingInProgress = false; + this.attr.uploading = false; this.$node.html(viewHelper.i18n('send-button')); this.enableButton(); }; @@ -104,6 +115,9 @@ define([ this.on(this.$node, 'click', this.updateRecipientsAndSendMail); + this.on(document, events.mail.uploadingAttachment, this.uploadInProgress); + this.on(document, events.mail.uploadedAttachment, this.uploadFinished); + this.on(document, events.dispatchers.rightPane.clear, this.teardown); this.on(document, events.ui.sendbutton.enable, this.resetButton); this.on(document, events.mail.send_failed, this.resetButton); |