aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rwxr-xr-xpublic/css/gogs.css8
-rw-r--r--public/js/app.js38
2 files changed, 45 insertions, 1 deletions
diff --git a/public/css/gogs.css b/public/css/gogs.css
index a8311188..bfca9d83 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -1297,7 +1297,7 @@ html, body {
display: block;
}
-#issue .label-filter a:hover {
+#issue .label-filter li.label-item:hover {
background-color: #FFF;
}
@@ -1316,6 +1316,12 @@ html, body {
margin-top: 6px;
}
+#issue .label-filter .del {
+ margin-top: -24px;
+ color: #888;
+ display: none;
+}
+
#issue .label-filter .label-button {
margin-top: 16px;
}
diff --git a/public/js/app.js b/public/js/app.js
index d7514f79..53948578 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -612,6 +612,44 @@ function initIssue() {
$('#milestone').text($('#milestone').data("no-milestone"));
}
});
+
+ // labels
+ $('#label-manage-btn').on("click", function () {
+ var $list = $('#label-list');
+ if ($list.hasClass("managing")) {
+ var ids = [];
+ $list.find('li').each(function (i, item) {
+ var id = $(item).data("id");
+ if (id > 0) {
+ ids.push(id);
+ }
+ });
+ $.post($list.data("ajax"), {"ids": ids.join(",")}, function (json) {
+ if (json.ok) {
+ window.location.reload();
+ }
+ })
+ } else {
+ $list.addClass("managing");
+ $list.find(".count").hide();
+ $list.find(".del").show();
+ $(this).text("Save Labels");
+ $list.on('click', 'li.label-item', function () {
+ var $this = $(this);
+ $this.after($('.label-change-li').detach().show());
+ $('#label-name-change-ipt').val($this.find('.name').text());
+ var color = $this.find('.color').data("color");
+ $('.label-change-color-picker').colorpicker("setValue", color);
+ $('#label-color-change-ipt').val(color);
+ $('#label-change-id-ipt').val($this.data("id"));
+ return false;
+ });
+ }
+ });
+ $("#label-list").on('click', '.del', function () {
+ $(this).parent().remove();
+ return false;
+ });
}
function initRelease() {