From 935b1b6f1f200a995dc1f82391a26dfe59a87e50 Mon Sep 17 00:00:00 2001 From: Giovane Date: Fri, 27 Nov 2015 21:12:19 -0200 Subject: Permanently delete discarded drafts #512 w/ bwagner --- web-ui/app/js/mixins/with_mail_edit_base.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'web-ui/app/js/mixins') 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); } -- cgit v1.2.3