mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
fixed commenting on post
This commit is contained in:
parent
d4b14948f3
commit
b8b2174301
2 changed files with 6 additions and 2 deletions
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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('');
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue