Vulcan/client/views/comments/comment_list.js

21 lines
656 B
JavaScript
Raw Normal View History

Template.comment_list.created = function(){
postObject = this.data;
}
Template.comment_list.helpers({
has_comments: function(){
var post = this;
2014-06-22 10:34:39 +09:00
var comments = Comments.find({postId: post._id, parent: null}, {sort: {score: -1, submitted: -1}});
return comments.count() > 0;
},
child_comments: function(){
var post = this;
2014-06-22 10:34:39 +09:00
var comments = Comments.find({postId: post._id, parent: null}, {sort: {score: -1, submitted: -1}});
return comments;
}
});
Template.comment_list.rendered = function(){
2013-10-23 10:40:29 +08:00
// once all comments have been rendered, activate comment queuing for future real-time comments
window.queueComments = true;
}