Vulcan/client/views/comments/comment_list.js

24 lines
777 B
JavaScript
Raw Normal View History

2014-07-05 11:24:28 +09:00
Template[getTemplate('comment_list')].created = function(){
postObject = this.data;
}
2014-07-05 11:24:28 +09:00
Template[getTemplate('comment_list')].helpers({
2014-07-05 11:42:28 +09:00
comment_item: function () {
return getTemplate('comment_item');
},
has_comments: function(){
var post = this;
2014-07-03 13:15:23 +09:00
var comments = Comments.find({postId: post._id, parent: null}, {sort: {score: -1, postedAt: -1}});
return comments.count() > 0;
},
child_comments: function(){
var post = this;
2014-07-03 13:15:23 +09:00
var comments = Comments.find({postId: post._id, parent: null}, {sort: {score: -1, postedAt: -1}});
return comments;
}
});
2014-07-05 11:24:28 +09:00
Template[getTemplate('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;
}