Vulcan/packages/nova-comments/lib/client/templates/comment_list.js

18 lines
637 B
JavaScript
Raw Normal View History

Template.comment_list.helpers({
commentListClass: function () {
var post = this;
var comments = Comments.find({postId: post._id, parentCommentId: null}, {sort: {score: -1, postedAt: -1}});
return !!comments.count() ? "has-comments" : "no-comments";
},
childComments: function(){
var post = this;
2014-07-05 16:21:28 +09:00
var comments = Comments.find({postId: post._id, parentCommentId: null}, {sort: {score: -1, postedAt: -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;
2015-04-13 16:29:33 +09:00
};