Work on the card activities and comments

This commit also introduces a new CSSEvents object that is used to
abstract vendor specifics events related to CSS transitions and
animations.

Fixes #183.
Fixes #179.
This commit is contained in:
Maxime Quandalle 2015-06-12 13:59:39 +02:00
parent 216887490e
commit c894567987
31 changed files with 590 additions and 691 deletions

View file

@ -49,10 +49,6 @@ BlazeComponent.extendComponent({
return TAPi18n.__('this-board');
},
cardLabel: function() {
return TAPi18n.__('this-card');
},
cardLink: function() {
var card = this.currentData().card();
return Blaze.toHTML(HTML.A({
@ -75,3 +71,35 @@ BlazeComponent.extendComponent({
}, attachment.name()));
}
}).register('activities');
BlazeComponent.extendComponent({
template: function() {
return 'cardActivities';
},
cardLabel: function() {
return TAPi18n.__('this-card');
},
events: function() {
return [{
// XXX We should use Popup.afterConfirmation here
'click .js-delete-comment': function() {
var commentId = this.currentData().commentId;
CardComments.remove(commentId);
},
'submit .js-edit-comment': function(evt) {
evt.preventDefault();
var commentText = this.currentComponent().getValue();
var commentId = Template.parentData().commentId;
if ($.trim(commentText)) {
CardComments.update(commentId, {
$set: {
text: commentText
}
});
}
}
}];
}
}).register('cardActivities');