summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-26 02:48:17 +0800
committerUnknwon <u@gogs.io>2016-07-26 02:48:17 +0800
commit899e7994595f5fc500de8cdf39e1b737f9f00982 (patch)
tree1477940293968f1ee2781e04209b7038e9774d95 /public
parent2295fafb34e2467f3b380a4db8832aa2c70ecc5a (diff)
downloadgitea-899e7994595f5fc500de8cdf39e1b737f9f00982.tar.gz
gitea-899e7994595f5fc500de8cdf39e1b737f9f00982.zip
#1601 support delete issue comment
Diffstat (limited to 'public')
-rw-r--r--public/css/gogs.css5
-rw-r--r--public/js/gogs.js15
-rw-r--r--public/less/_repository.less11
3 files changed, 25 insertions, 6 deletions
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 6c3cb6e891..681a9febed 100644
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -1452,7 +1452,10 @@ footer .ui.language .menu {
.repository.view.issue .comment-list .comment .actions .item {
float: left;
}
-.repository.view.issue .comment-list .comment .actions a.item {
+.repository.view.issue .comment-list .comment .actions .item.tag {
+ margin-right: 5px;
+}
+.repository.view.issue .comment-list .comment .actions .item.action {
margin-top: 6px;
margin-left: 10px;
}
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 () {
diff --git a/public/less/_repository.less b/public/less/_repository.less
index 023fab0ef4..403bb17b69 100644
--- a/public/less/_repository.less
+++ b/public/less/_repository.less
@@ -393,10 +393,13 @@
.actions {
.item {
float: left;
- }
- a.item {
- margin-top: 6px;
- margin-left: 10px;
+ &.tag {
+ margin-right: 5px;
+ }
+ &.action {
+ margin-top: 6px;
+ margin-left: 10px;
+ }
}
}
.content {