Vulcan/packages/telescope-comments/lib/routes.js

49 lines
1 KiB
JavaScript
Raw Normal View History

// Controller for comment pages
Comments.controllers = {};
2015-04-22 08:47:23 +09:00
Comments.controllers.page = RouteController.extend({
waitOn: function() {
return [
2015-01-20 16:18:27 +09:00
coreSubscriptions.subscribe('singleCommentAndChildren', this.params._id),
coreSubscriptions.subscribe('commentUsers', this.params._id),
coreSubscriptions.subscribe('commentPost', this.params._id)
];
},
data: function() {
return {
comment: Comments.findOne(this.params._id)
};
},
onAfterAction: function () {
window.queueComments = false;
2014-11-27 17:25:01 +05:30
},
fastRender: true
});
Meteor.startup( function () {
// Comment Reply
Router.route('/comments/:_id', {
name: 'comment_page',
2015-04-13 16:29:33 +09:00
template: 'comment_reply',
2015-04-22 08:47:23 +09:00
controller: Comments.controllers.page,
onAfterAction: function() {
window.queueComments = false;
}
});
// Comment Edit
Router.route('/comments/:_id/edit', {
name: 'comment_edit',
2015-04-13 16:29:33 +09:00
template: 'comment_edit',
2015-04-22 08:47:23 +09:00
controller: Comments.controllers.page,
onAfterAction: function() {
window.queueComments = false;
}
});
2015-04-13 16:29:33 +09:00
});