2013-10-09 20:23:20 +09:00
|
|
|
Template.comment_list.created = function(){
|
2013-10-21 23:07:36 +08:00
|
|
|
postObject = this.data;
|
2013-10-09 20:23:20 +09:00
|
|
|
}
|
|
|
|
|
2012-10-10 07:28:44 +09:00
|
|
|
Template.comment_list.helpers({
|
|
|
|
has_comments: function(){
|
2013-10-21 23:07:36 +08:00
|
|
|
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}});
|
2013-10-21 23:07:36 +08:00
|
|
|
return comments.count() > 0;
|
2012-10-10 07:28:44 +09:00
|
|
|
},
|
|
|
|
child_comments: function(){
|
2013-10-21 23:07:36 +08:00
|
|
|
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}});
|
2013-10-21 23:07:36 +08:00
|
|
|
return comments;
|
2012-09-09 13:38:56 +09:00
|
|
|
}
|
2013-10-23 08:14:06 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
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
|
2013-10-23 08:14:06 +08:00
|
|
|
window.queueComments = true;
|
|
|
|
}
|