summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_list
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-20 13:52:21 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-20 13:52:21 +0200
commitb839ea36d4aee965471420a45b85f95c87335c35 (patch)
treecb0aec5754ac3b0765de1a5709f401db0f76e1d2 /web-ui/app/js/mail_list
parentf82306d6703dcad6d53c9fba64ef652a57d0608c (diff)
Fixing check select all for mail list and formatting mail_list.js
Diffstat (limited to 'web-ui/app/js/mail_list')
-rw-r--r--web-ui/app/js/mail_list/ui/mail_list.js40
1 files changed, 20 insertions, 20 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 e873d279..0d8c8919 100644
--- a/web-ui/app/js/mail_list/ui/mail_list.js
+++ b/web-ui/app/js/mail_list/ui/mail_list.js
@@ -56,7 +56,7 @@ define(
}
function triggerMailOpenForPopState(data) {
- if(data.mailIdent) {
+ if (data.mailIdent) {
self.trigger(document, openMailEventFor(data.tag), { ident: data.mailIdent });
}
}
@@ -78,7 +78,7 @@ define(
self.attr.currentTag = data.tag || self.attr.currentTag;
- self.updateCheckAllCheckbox();
+ self.updateCheckAllCheckbox();
}
function renderMails(mails) {
@@ -90,7 +90,7 @@ define(
}
- this.triggerScrollReset = function() {
+ this.triggerScrollReset = function () {
this.trigger(document, events.dispatchers.middlePane.resetScroll);
};
@@ -111,21 +111,21 @@ define(
};
this.updateSelected = function (ev, data) {
- if(data.ident !== this.attr.currentMailIdent){
+ if (data.ident !== this.attr.currentMailIdent) {
this.uncheckCurrentMail();
this.attr.currentMailIdent = data.ident;
}
this.checkCurrentMail();
};
- this.checkCurrentMail = function() {
- $('#mail-'+this.attr.currentMailIdent+' input:checkbox')
+ this.checkCurrentMail = function () {
+ $('#mail-' + this.attr.currentMailIdent + ' input:checkbox')
.attr('checked', true)
.trigger('change');
};
- this.uncheckCurrentMail = function() {
- $('#mail-'+this.attr.currentMailIdent+' input:checkbox')
+ this.uncheckCurrentMail = function () {
+ $('#mail-' + this.attr.currentMailIdent + ' input:checkbox')
.attr('checked', false)
.trigger('change');
};
@@ -135,7 +135,7 @@ define(
};
this.respondWithCheckedMails = function (ev, caller) {
- this.trigger(caller, events.ui.mail.hereChecked, { checkedMails : this.checkedMailsForCurrentTag()});
+ this.trigger(caller, events.ui.mail.hereChecked, { checkedMails: this.checkedMailsForCurrentTag()});
};
this.updateCheckAllCheckbox = function () {
@@ -146,13 +146,13 @@ define(
}
};
- this.checkedMailsForCurrentTag = function() {
- var checkedMailsForCurrentTag = _.filter(self.attr.checkedMails, function(mail) {
- return _.contains(mail.tags, self.attr.currentTag);
- });
-
- return checkedMailsForCurrentTag.length > 0 ? checkedMailsForCurrentTag : {};
- }
+ this.checkedMailsForCurrentTag = function () {
+ var checkedMailsForCurrentTag = _.filter(self.attr.checkedMails, function (mail) {
+ return mail.mailbox == self.attr.currentTag || _.contains(mail.tags, self.attr.currentTag);
+ });
+
+ return checkedMailsForCurrentTag.length > 0 ? checkedMailsForCurrentTag : {};
+ };
this.addToSelectedMails = function (ev, data) {
this.attr.checkedMails[data.mail.ident] = data.mail;
@@ -161,7 +161,7 @@ define(
this.removeFromSelectedMails = function (ev, data) {
if (data.mails) {
- _.each(data.mails, function(mail) {
+ _.each(data.mails, function (mail) {
delete this.attr.checkedMails[mail.ident];
}, this);
} else {
@@ -176,13 +176,13 @@ define(
};
this.refreshAfterSaveDraft = function () {
- if(this.attr.currentTag === 'drafts') {
+ if (this.attr.currentTag === 'drafts') {
this.refreshWithScroll();
}
};
this.refreshAfterMailSent = function () {
- if(this.attr.currentTag === 'drafts' || this.attr.currentTag === 'sent') {
+ if (this.attr.currentTag === 'drafts' || this.attr.currentTag === 'sent') {
this.refreshWithScroll();
}
};
@@ -204,7 +204,7 @@ define(
this.on(document, events.ui.mail.unchecked, this.removeFromSelectedMails);
this.openMailFromUrl = utils.once(function () {
- if(shouldSelectEmailFromUrlMailIdent()) {
+ if (shouldSelectEmailFromUrlMailIdent()) {
selectMailBasedOnUrlMailIdent();
}
});