fixed commenting on post

This commit is contained in:
Troy Goode 2012-08-31 19:08:15 -04:00
parent d4b14948f3
commit b8b2174301
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,6 @@
Template.post.events = {
'click .discuss-link': function(){
'click .discuss-link': function(evt){
evt.preventDefault();
Session.set('selected_post', this);
Session.set('state', 'view_post');
}

View file

@ -1,5 +1,7 @@
Template.selected_post.events = {
'click input[type=submit]': function(){
'click input[type=submit]': function(evt){
evt.preventDefault();
var post = Session.get('selected_post');
var $comment = $('#comment');
var comment = {
@ -8,6 +10,7 @@ Template.selected_post.events = {
, submitter: Meteor.user().username
, submitted: new Date().getTime()
};
Comments.insert(comment);
$comment.val('');
}