fix for comment issue

This commit is contained in:
Kyle Drake 2015-06-23 11:22:27 -07:00
parent 35c8a98ec0
commit e50239ee39
2 changed files with 1 additions and 4 deletions

View file

@ -3,16 +3,13 @@ var Comment = {
var form = $(form)
var comment = form.find('[name="comment"]').val()
form.remove()
$.post('/event/'+eventId+'/comment', {csrf_token: csrfToken, message: comment}, function(res) {
console.log(res)
location.reload()
})
},
delete: function(commentId, csrfToken) {
$.post('/comment/'+commentId+'/delete', {csrf_token: csrfToken}, function(res) {
console.log(res)
location.reload()
})
},

View file

@ -1,5 +1,5 @@
<div id="comment-template" style="display: none">
<form onsubmit="Comment.create({{ eventId }}, '<%= csrf_token %>', this); location.reload(); return false">
<form onsubmit="Comment.create({{ eventId }}, '<%= csrf_token %>', this); return false">
<input name="comment" type="text" autocomplete="off" maxlength="<%= Site::MAX_COMMENT_SIZE %>" style="width: 100%" placeholder="Comment on this...">
<button class="btn-Action">Post</button>
</form>