From 3a01348e02407dac3cf46ff79225d933e83ca11e Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 7 Apr 2015 15:25:15 +0300 Subject: [PATCH] improve draft email --- .../Espo/Resources/i18n/en_US/Email.json | 3 ++- .../client/src/views/modals/compose-email.js | 18 +++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/application/Espo/Resources/i18n/en_US/Email.json b/application/Espo/Resources/i18n/en_US/Email.json index 1793001b05..d4d2571a88 100644 --- a/application/Espo/Resources/i18n/en_US/Email.json +++ b/application/Espo/Resources/i18n/en_US/Email.json @@ -49,7 +49,8 @@ "messages": { "noSmtpSetup": "No SMTP setup. {link}.", "testEmailSent": "Test email has been sent", - "emailSent": "Email has been sent" + "emailSent": "Email has been sent", + "savedAsDraft": "Saved as draft" }, "presetFilters": { "sent": "Sent", diff --git a/frontend/client/src/views/modals/compose-email.js b/frontend/client/src/views/modals/compose-email.js index a3c6794ad2..2122ce4baf 100644 --- a/frontend/client/src/views/modals/compose-email.js +++ b/frontend/client/src/views/modals/compose-email.js @@ -47,17 +47,21 @@ Espo.define('Views.Modals.ComposeEmail', 'Views.Modals.Edit', function (Dep) { var model = editView.model; - var afterSave = function () { - this.trigger('after:save', model); - dialog.close(); - }; - - editView.once('after:save', afterSave , this); - var $send = dialog.$el.find('button[data-name="send"]'); $send.addClass('disabled'); var $saveDraft = dialog.$el.find('button[data-name="saveDraft"]'); $saveDraft.addClass('disabled'); + + var afterSave = function () { + $saveDraft.removeClass('disabled'); + $send.removeClass('disabled'); + Espo.Ui.success(this.translate('savedAsDraft', 'messages', 'Email')); + //this.trigger('after:save', model); + //dialog.close(); + }.bind(this); + + editView.once('after:save', afterSave , this); + editView.once('cancel:save', function () { $send.removeClass('disabled'); $saveDraft.removeClass('disabled');