Skip to content
/ gitea Public
forked from go-gitea/gitea

Commit

Permalink
Scoped labels: don't require holding alt key to remove
Browse files Browse the repository at this point in the history
Alt doesn't work on all browsers, the simplest solution for v1.19 is to just
not require it and toggle the label by just clicking.

Part of go-gitea#22974
  • Loading branch information
brechtvl committed Mar 4, 2023
1 parent 5c4075e commit 3db747e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions web_src/js/features/repo-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,14 @@ export function initRepoCommentForm() {

const clickedItem = $(this);
const scope = $(this).attr('data-scope');
const canRemoveScope = e.altKey;

$(this).parent().find('.item').each(function () {
if (scope) {
// Enable only clicked item for scoped labels
if ($(this).attr('data-scope') !== scope) {
return true;
}
if ($(this).is(clickedItem)) {
if (!canRemoveScope && $(this).hasClass('checked')) {
return true;
}
} else if (!$(this).hasClass('checked')) {
if (!$(this).is(clickedItem) && !$(this).hasClass('checked')) {
return true;
}
} else if (!$(this).is(clickedItem)) {
Expand Down

0 comments on commit 3db747e

Please sign in to comment.