mirror of
https://github.com/neocities/neocities.git
synced 2026-05-26 16:34:02 +00:00
fix for comment issue
This commit is contained in:
@@ -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()
|
||||
})
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user