summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_list
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2015-02-22 04:36:40 -0300
committerDuda Dornelles <ddornell@thoughtworks.com>2015-02-22 04:43:26 -0300
commit66ff78361a8ef71bc05e95e614401a114b6ae42c (patch)
treee57ae83e6695939781557a3cb9ffce7e508a4cc3 /web-ui/app/js/mail_list
parent26be3c59b174eb9f1a6f73c67489738c7517ce8c (diff)
#289 making checked mail tag aware
Diffstat (limited to 'web-ui/app/js/mail_list')
-rw-r--r--web-ui/app/js/mail_list/ui/mail_list.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/web-ui/app/js/mail_list/ui/mail_list.js b/web-ui/app/js/mail_list/ui/mail_list.js
index 69327a57..3f7a4da3 100644
--- a/web-ui/app/js/mail_list/ui/mail_list.js
+++ b/web-ui/app/js/mail_list/ui/mail_list.js
@@ -43,7 +43,7 @@ define(
});
this.appendMail = function (mail) {
- var isChecked = mail.ident in this.attr.checkedMails;
+ var isChecked = this.attr.checkedMails[this.attr.currentTag] && mail.ident in this.attr.checkedMails[this.attr.currentTag];
MailItemFactory.createAndAttach(this.$node, mail, this.attr.currentMailIdent, this.attr.currentTag, isChecked);
};
@@ -117,25 +117,29 @@ define(
};
this.respondWithCheckedMails = function (ev, caller) {
- this.trigger(caller, events.ui.mail.hereChecked, {checkedMails: this.attr.checkedMails});
+ this.trigger(caller, events.ui.mail.hereChecked, {checkedMails: this.attr.checkedMails[this.attr.currentTag]});
};
this.updateCheckAllCheckbox = function () {
- this.trigger(document, events.ui.mails.hasMailsChecked, _.keys(this.attr.checkedMails).length > 0);
+ debugger;
+ this.trigger(document, events.ui.mails.hasMailsChecked, _.keys(this.attr.checkedMails[this.attr.currentTag]).length > 0);
};
this.addToCheckedMails = function (ev, data) {
- this.attr.checkedMails[data.mail.ident] = data.mail;
+ if (!this.attr.checkedMails[this.attr.currentTag]) {
+ this.attr.checkedMails[this.attr.currentTag] = {};
+ }
+ this.attr.checkedMails[this.attr.currentTag][data.mail.ident] = data.mail;
this.updateCheckAllCheckbox();
};
this.removeFromCheckedMails = function (ev, data) {
if (data.mails) {
_.each(data.mails, function (mail) {
- delete this.attr.checkedMails[mail.ident];
+ delete this.attr.checkedMails[this.attr.currentTag][mail.ident];
}, this);
} else {
- delete this.attr.checkedMails[data.mail.ident];
+ delete this.attr.checkedMails[this.attr.currentTag][data.mail.ident];
}
this.updateCheckAllCheckbox();
};