Vulcan/client/templates/comment.js

19 lines
480 B
JavaScript
Raw Normal View History

2012-08-23 00:15:48 -04:00
Template.comment.events = {
'click .comment-reply': function(event){
event.preventDefault();
Session.set('selected_comment', this);
Session.set('state', 'reply');
}
};
2012-08-22 23:40:09 -04:00
Template.comment.ago = function(){
var submitted = new Date(this.submitted);
return submitted.toString();
};
2012-08-23 00:35:31 -04:00
2012-08-23 00:51:31 -04:00
Template.comment.child_comments = function(){
2012-08-23 00:35:31 -04:00
var post = Session.get('selected_post');
var comments = Comments.find({ post: post._id, parent: this._id });
return comments;
};