From 26be3c59b174eb9f1a6f73c67489738c7517ce8c Mon Sep 17 00:00:00 2001 From: rafael lisboa Date: Fri, 20 Feb 2015 15:08:24 -0200 Subject: Open draft e-mails in edit view when shown in the "all" tab --- web-ui/app/js/mail_list/ui/mail_item_factory.js | 4 ++-- web-ui/app/js/services/model/mail.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'web-ui') diff --git a/web-ui/app/js/mail_list/ui/mail_item_factory.js b/web-ui/app/js/mail_list/ui/mail_item_factory.js index e7e52cc2..88638c9d 100644 --- a/web-ui/app/js/mail_list/ui/mail_item_factory.js +++ b/web-ui/app/js/mail_list/ui/mail_item_factory.js @@ -55,9 +55,9 @@ define( }; var detectMailType = function(mail) { - if(_.include(mail.tags, 'drafts')) { + if (mail.isDraftMail()) { return MAIL_ITEM_TYPE.drafts; - } else if(_.include(mail.tags, 'sent')) { + } else if (mail.isSentMail()) { return MAIL_ITEM_TYPE.sent; } else { return GenericMailItem; diff --git a/web-ui/app/js/services/model/mail.js b/web-ui/app/js/services/model/mail.js index 43ab4b86..34cba610 100644 --- a/web-ui/app/js/services/model/mail.js +++ b/web-ui/app/js/services/model/mail.js @@ -22,15 +22,15 @@ define(['helpers/contenttype'], var asMail = (function () { function isSentMail() { - return this.mailbox === 'SENT'; + return _.has(this, 'mailbox') && this.mailbox.toUpperCase() === 'SENT'; } function isDraftMail() { - return this.mailbox === 'DRAFTS'; + return _.has(this, 'mailbox') && this.mailbox.toUpperCase() === 'DRAFTS'; } function isInTrash() { - return this.mailbox && this.mailbox.toLowerCase() === 'trash'; + return _.has(this, 'mailbox') && this.mailbox.toUpperCase() === 'TRASH'; } function setDraftReplyFor(ident) { -- cgit v1.2.3