summaryrefslogtreecommitdiffstats
path: root/client/components/activities/activities.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-12 13:59:39 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-12 17:48:15 +0200
commitc8945679872a0708eb67a477a99a65d508c84cb0 (patch)
tree5cf9f2cc842f891451f7bc247b5f0833c1ab39e7 /client/components/activities/activities.js
parent216887490e3be0ba141484afc11d37475e91562d (diff)
downloadwekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.gz
wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.bz2
wekan-c8945679872a0708eb67a477a99a65d508c84cb0.zip
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.
Diffstat (limited to 'client/components/activities/activities.js')
-rw-r--r--client/components/activities/activities.js36
1 files changed, 32 insertions, 4 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js
index c806e87b..5d95006a 100644
--- a/client/components/activities/activities.js
+++ b/client/components/activities/activities.js
@@ -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');