Allow a user to edit its profile or avatar from a member popover

Fixes the data context on the member popover in the details pane. Also
change the way Popover detect if the click is initiated from a parent
popover -- from reading Blaze context, to looking at the event target
parents.
This commit is contained in:
Maxime Quandalle 2015-06-19 14:39:38 +02:00
parent fad4cba5e2
commit 8cf9ec2660
8 changed files with 70 additions and 55 deletions

View file

@ -26,6 +26,10 @@ Template.userAvatar.helpers({
}
});
Template.userAvatar.events({
'click .js-change-avatar': Popup.open('changeAvatar')
});
Template.userAvatarInitials.helpers({
initials: function() {
var user = Users.findOne(this.userId);
@ -142,9 +146,16 @@ Template.cardMembersPopup.events({
}
});
Template.cardMemberPopup.helpers({
user: function() {
return Users.findOne(this.userId);
}
});
Template.cardMemberPopup.events({
'click .js-remove-member': function() {
Cards.update(this.cardId, {$pull: {members: this.userId}});
Popup.close();
}
},
'click .js-edit-profile': Popup.open('editProfile')
});