From e3c370a28f3ec8a2802a5098ed0cbb777292eba9 Mon Sep 17 00:00:00 2001 From: rafael lisboa Date: Fri, 20 Feb 2015 19:22:18 -0200 Subject: Add pencil icon to drafts --- web-ui/app/js/mail_list/ui/mail_item_factory.js | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'web-ui/app/js/mail_list') 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 88638c9d..87a883b0 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 @@ -30,7 +30,7 @@ define( }; var TEMPLATE_TYPE = { - 'drafts': 'sent', + 'drafts': 'draft', 'sent': 'sent' }; @@ -38,32 +38,17 @@ define( var mailItemContainer = $('
  • ', { id: 'mail-' + mail.ident}); nodeToAttachTo.append(mailItemContainer); - var mailToCreate; - if(currentTag === 'all'){ - mailToCreate = detectMailType(mail); - } else { - mailToCreate = MAIL_ITEM_TYPE[currentTag] || GenericMailItem; - } + var mailToCreate = MAIL_ITEM_TYPE[mail.mailbox] || GenericMailItem; mailToCreate.attachTo(mailItemContainer, { mail: mail, selected: mail.ident === currentMailIdent, tag: currentTag, isChecked: isChecked, - templateType: TEMPLATE_TYPE[currentTag] || 'single' + templateType: TEMPLATE_TYPE[mail.mailbox] || 'single' }); }; - var detectMailType = function(mail) { - if (mail.isDraftMail()) { - return MAIL_ITEM_TYPE.drafts; - } else if (mail.isSentMail()) { - return MAIL_ITEM_TYPE.sent; - } else { - return GenericMailItem; - } - }; - return { createAndAttach: createAndAttach }; -- cgit v1.2.3