Vulcan/lib/router/comments.js
2014-11-27 17:25:01 +05:30

46 lines
No EOL
1 KiB
JavaScript

// Controller for comment pages
CommentPageController = RouteController.extend({
waitOn: function() {
return [
coreSubscriptions.subscribe('singleComment', this.params._id),
coreSubscriptions.subscribe('commentUser', this.params._id),
coreSubscriptions.subscribe('commentPost', this.params._id)
];
},
data: function() {
return {
comment: Comments.findOne(this.params._id)
};
},
onAfterAction: function () {
window.queueComments = false;
},
fastRender: true
});
Meteor.startup( function () {
// Comment Reply
Router.route('/comments/:_id', {
name: 'comment_reply',
template: getTemplate('comment_reply'),
controller: CommentPageController,
onAfterAction: function() {
window.queueComments = false;
}
});
// Comment Edit
Router.route('/comments/:_id/edit', {
name: 'comment_edit',
template: getTemplate('comment_edit'),
controller: CommentPageController,
onAfterAction: function() {
window.queueComments = false;
}
});
});