summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/css/index.css2
-rw-r--r--public/js/index.js35
-rw-r--r--public/less/_repository.less17
3 files changed, 52 insertions, 2 deletions
diff --git a/public/css/index.css b/public/css/index.css
index 9292604422..e404c1fec6 100644
--- a/public/css/index.css
+++ b/public/css/index.css
@@ -458,6 +458,8 @@ i.icon.centerlock{top:1.5em}
.repository .filter.menu .label.color{border-radius:3px;margin-left:15px;padding:0 8px}
.repository .filter.menu .octicon{float:left;margin:5px -7px 0 -5px;width:16px}
.repository .filter.menu.labels .octicon{margin:-2px -7px 0 -5px}
+.repository .filter.menu.labels .label-filter .menu .info{display:inline-block;padding:9px 7px 7px 7px;text-align:center;border-bottom:1px solid #ccc;font-size:12px}
+.repository .filter.menu.labels .label-filter .menu .info code{border:1px solid #ccc;border-radius:3px;padding:3px 2px 1px 2px;font-size:11px}
.repository .filter.menu .text{margin-left:.9em}
.repository .filter.menu .menu{max-height:300px;overflow-x:auto;right:0!important;left:auto!important}
.repository .filter.menu .dropdown.item{margin:1px;padding-right:0}
diff --git a/public/js/index.js b/public/js/index.js
index 90819677a5..cf19bf71a0 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -3278,8 +3278,39 @@ function initIssueList() {
},
fullTextSearch: true
- })
- ;
+ });
+
+ $(".menu a.label-filter-item").each(function() {
+ $(this).click(function(e) {
+ if (e.altKey) {
+ const href = $(this).attr("href");
+ const id = $(this).data("label-id");
+
+ const regStr = "labels=(-?[0-9]+%2c)*(" + id + ")(%2c-?[0-9]+)*&";
+ const newStr = "labels=$1-$2$3&";
+
+ window.location = href.replace(new RegExp(regStr), newStr);
+ }
+ });
+ });
+
+ $(".menu .ui.dropdown.label-filter").keydown(function(e) {
+ if (e.altKey && e.keyCode == 13) {
+ const selectedItems = $(".menu .ui.dropdown.label-filter .menu .item.selected");
+
+ if (selectedItems.length > 0) {
+ const item = $(selectedItems[0]);
+
+ const href = item.attr("href");
+ const id = item.data("label-id");
+
+ const regStr = "labels=(-?[0-9]+%2c)*(" + id + ")(%2c-?[0-9]+)*&";
+ const newStr = "labels=$1-$2$3&";
+
+ window.location = href.replace(new RegExp(regStr), newStr);
+ }
+ }
+ });
}
function cancelCodeComment(btn) {
const form = $(btn).closest("form");
diff --git a/public/less/_repository.less b/public/less/_repository.less
index 33ee5761c4..48a1214c07 100644
--- a/public/less/_repository.less
+++ b/public/less/_repository.less
@@ -158,6 +158,23 @@
margin: -2px -7px 0 -5px;
}
+ &.labels {
+ .label-filter .menu .info {
+ display: inline-block;
+ padding: 9px 7px 7px 7px;
+ text-align: center;
+ border-bottom: 1px solid #cccccc;
+ font-size: 12px;
+
+ code {
+ border: 1px solid #cccccc;
+ border-radius: 3px;
+ padding: 3px 2px 1px 2px;
+ font-size: 11px;
+ }
+ }
+ }
+
.text {
margin-left: 0.9em;
}