(js) Move 'Reply All' action to a distinct button

This commit is contained in:
Francis Lachapelle
2015-11-24 16:30:36 -05:00
parent 5a5b4cc829
commit b6930fde26
2 changed files with 26 additions and 7 deletions
@@ -212,6 +212,24 @@
return address;
};
/**
* @function allowReplyAll
* @memberof Message.prototype
* @desc Check if 'Reply to All' is an appropriate action on the message.
* @returns true if the message is not a draft and has more than one recipient
*/
Message.prototype.allowReplyAll = function() {
var recipientsCount = 0;
recipientsCount = _.reduce(['to', 'cc'], function(count, type) {
if (this[type])
return count + this[type].length;
else
return count;
}, recipientsCount, this);
return !this.isDraft && recipientsCount > 1;
};
/**
* @function loadUnsafeContent
* @memberof Message.prototype