(js) Improve autocomplete of attendees editor

This commit is contained in:
Francis Lachapelle
2015-06-05 16:20:57 -04:00
parent a95ed0f8e6
commit 290264262c
4 changed files with 49 additions and 7 deletions
@@ -468,6 +468,22 @@
}
};
/**
* @function hasAttendee
* @memberof Component.prototype
* @desc Verify if one of the email addresses of a Card instance matches an attendee
* @param {Object} card - an Card object instance
* @returns true if the Card matches an attendee
*/
Component.prototype.hasAttendee = function(card) {
var attendee = _.find(this.attendees, function(attendee) {
return _.find(card.emails, function(email) {
return email.value == attendee.email;
});
});
return angular.isDefined(attendee);
}
/**
* @function $reset
* @memberof Component.prototype