summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mixins
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-11-27 21:12:19 -0200
committerGiovane <giovaneliberato@gmail.com>2015-11-27 21:12:58 -0200
commit935b1b6f1f200a995dc1f82391a26dfe59a87e50 (patch)
treedcd751443b0966e6b5dcda2f9accf3eacb44171a /web-ui/app/js/mixins
parent230ac791547576850e886e1d927b400dbe65e505 (diff)
Permanently delete discarded drafts #512 w/ bwagner
Diffstat (limited to 'web-ui/app/js/mixins')
-rw-r--r--web-ui/app/js/mixins/with_mail_edit_base.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/web-ui/app/js/mixins/with_mail_edit_base.js b/web-ui/app/js/mixins/with_mail_edit_base.js
index a3c88e66..36d5980f 100644
--- a/web-ui/app/js/mixins/with_mail_edit_base.js
+++ b/web-ui/app/js/mixins/with_mail_edit_base.js
@@ -91,7 +91,7 @@ define(
this.attr.recipientValues = context.recipients;
this.attachRecipients(context);
- this.on(this.select('trashButton'), 'click', this.trashMail);
+ this.on(this.select('trashButton'), 'click', this.discardMail);
SendButton.attachTo(this.select('sendButton'));
this.warnSendButtonOfRecipients();
@@ -103,12 +103,6 @@ define(
DraftSaveStatus.attachTo(this.select('draftSaveStatus'));
};
- this.deleteMail = function(data) {
- this.attr.ident = data.ident;
- var mail = this.buildMail();
- this.trigger(document, events.ui.mail.delete, { mail: mail });
- };
-
this.monitorInput = function() {
this.trigger(events.ui.mail.changedSinceLastSave);
this.cancelPostponedSaveDraft();
@@ -116,13 +110,11 @@ define(
this.postponeSaveDraft(mail);
};
- this.trashMail = function() {
+ this.discardMail = function() {
this.cancelPostponedSaveDraft();
if (this.attr.ident) {
- this.trigger(document, events.mail.save, {
- mail: this.buildMail(),
- callback: this.deleteMail.bind(this)
- });
+ var mail = this.buildMail();
+ this.trigger(document, events.ui.mail.delete, { mail: mail });
} else {
this.trigger(document, events.ui.mail.discard);
}