diff options
Diffstat (limited to 'public/assets/js/lib/views/details/comments.js')
| -rw-r--r-- | public/assets/js/lib/views/details/comments.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/public/assets/js/lib/views/details/comments.js b/public/assets/js/lib/views/details/comments.js index 688750c..b1c86bb 100644 --- a/public/assets/js/lib/views/details/comments.js +++ b/public/assets/js/lib/views/details/comments.js @@ -15,6 +15,8 @@ var CommentsView = FormView.extend({ }, load: function(comments, thread){ +console.log(comments) + thread = this.thread = thread || this.thread if (thread.settings.hootbox) { comments .sort((a,b) => cmp(a.date, b.date)) @@ -61,6 +63,10 @@ var CommentsView = FormView.extend({ var $el = this.parse(comment) $el.insertBefore(this.$formRow) }, + + removeComment: function(id) { + this.$("[title='" + id + "']").closest('tr').remove() + }, success: function(){ this.prependComment(comment) @@ -83,8 +89,9 @@ var CommentsView = FormView.extend({ url: "/api/comment/" + id, headers: { "csrf-token": $("[name=_csrf]").attr("value") }, data: { csrf: csrf() }, - success: function(){ - window.location.reload() + success: () => { + this.removeComment(id) + // window.location.reload() }, }) } |
