From 899e7994595f5fc500de8cdf39e1b737f9f00982 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 26 Jul 2016 02:48:17 +0800 Subject: #1601 support delete issue comment --- public/js/gogs.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index bf27d1584e..5445aa652a 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -342,7 +342,7 @@ function initRepository() { // Edit issue or comment content $('.edit-content').click(function () { - var $segment = $(this).parent().parent().next(); + var $segment = $(this).parent().parent().parent().next(); var $edit_content_zone = $segment.find('.edit-content-zone'); var $render_content = $segment.find('.render-content'); var $raw_content = $segment.find('.raw-content'); @@ -404,6 +404,19 @@ function initRepository() { return false; }); + // Delete comment + $('.delete-comment').click(function () { + var $this = $(this); + if (confirm($this.data('locale'))) { + $.post($this.data('url'), { + "_csrf": csrf + }).success(function() { + $('#' + $this.data('comment-id')).remove(); + }) + } + return false; + }); + // Change status var $status_btn = $('#status-button'); $('#content').keyup(function () { -- cgit v1.2.3