diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-16 13:53:16 +0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-16 13:54:03 +0200 |
commit | 0de9d8dc31298921f7272d74cdd3c5d4217b5841 (patch) | |
tree | 468ba5005379151eff72c5aaaf37db9ba29b3ef7 /web-ui/app/js/tags/ui/tag.js | |
parent | 761e85e523ec61f5629a9f1f6e4196e23ce96673 (diff) |
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
Diffstat (limited to 'web-ui/app/js/tags/ui/tag.js')
-rw-r--r-- | web-ui/app/js/tags/ui/tag.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web-ui/app/js/tags/ui/tag.js b/web-ui/app/js/tags/ui/tag.js index c2b7f588..2cf45764 100644 --- a/web-ui/app/js/tags/ui/tag.js +++ b/web-ui/app/js/tags/ui/tag.js @@ -52,9 +52,13 @@ define( }; this.decreaseReadCountIfMatchingTag = function (ev, data) { - if (_.contains(data.tags, this.attr.tag.name)) { + var mailbox_and_tags = _.flatten([data.tags, data.mailbox]); + if (_.contains(mailbox_and_tags, this.attr.tag.name)) { this.attr.tag.counts.read++; this.$node.html(this.viewFor(this.attr.tag, templates.tags.tagInner)); + if (!_.isUndefined(this.attr.shortcut)) { + this.attr.shortcut.reRender(); + } } }; |