mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fix for comment issue
This commit is contained in:
parent
35c8a98ec0
commit
e50239ee39
2 changed files with 1 additions and 4 deletions
|
@ -3,16 +3,13 @@ var Comment = {
|
||||||
var form = $(form)
|
var form = $(form)
|
||||||
var comment = form.find('[name="comment"]').val()
|
var comment = form.find('[name="comment"]').val()
|
||||||
form.remove()
|
form.remove()
|
||||||
|
|
||||||
$.post('/event/'+eventId+'/comment', {csrf_token: csrfToken, message: comment}, function(res) {
|
$.post('/event/'+eventId+'/comment', {csrf_token: csrfToken, message: comment}, function(res) {
|
||||||
console.log(res)
|
|
||||||
location.reload()
|
location.reload()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
delete: function(commentId, csrfToken) {
|
delete: function(commentId, csrfToken) {
|
||||||
$.post('/comment/'+commentId+'/delete', {csrf_token: csrfToken}, function(res) {
|
$.post('/comment/'+commentId+'/delete', {csrf_token: csrfToken}, function(res) {
|
||||||
console.log(res)
|
|
||||||
location.reload()
|
location.reload()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="comment-template" style="display: none">
|
<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...">
|
<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>
|
<button class="btn-Action">Post</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Add table
Reference in a new issue