From 0de9d8dc31298921f7272d74cdd3c5d4217b5841 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Thu, 16 Oct 2014 13:53:16 +0200 Subject: decreasing count on tag and tag shortcut when email is read. we were decreasing only tags that were also in the read mail, but we have also to look at the mailbox and compare that to the tags in the case of default tags #95 --- web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js | 3 ++- web-ui/app/js/mail_list/ui/mail_items/mail_item.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'web-ui/app/js/mail_list') diff --git a/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js b/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js index 3d426447..d5dfbf28 100644 --- a/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js +++ b/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js @@ -51,7 +51,8 @@ define( function updateMailStatusToRead() { if (!_.contains(this.attr.mail.status, this.status.READ)) { - this.trigger(document, events.mail.read, { ident: this.attr.ident, tags: this.attr.mail.tags }); + var mail_read_data = { ident: this.attr.ident, tags: this.attr.tags, mailbox: this.attr.mailbox }; + this.trigger(document, events.mail.read, mail_read_data); this.attr.mail.status.push(this.status.READ); this.$node.addClass(viewHelpers.formatStatusClasses(this.attr.mail.status)); } diff --git a/web-ui/app/js/mail_list/ui/mail_items/mail_item.js b/web-ui/app/js/mail_list/ui/mail_items/mail_item.js index 5a4192e6..5f1f354a 100644 --- a/web-ui/app/js/mail_list/ui/mail_items/mail_item.js +++ b/web-ui/app/js/mail_list/ui/mail_items/mail_item.js @@ -1,6 +1,6 @@ /* * Copyright (c) 2014 ThoughtWorks, Inc. - * + * * Pixelated is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -64,6 +64,7 @@ define( this.attr.ident = mail.ident; this.attr.statuses = viewHelper.formatStatusClasses(mail.status); this.attr.tags = mail.tags; + this.attr.mailbox = mail.mailbox; this.attr.header.formattedDate = this.formattedDate(mail.header.date); }; -- cgit v1.2.3