Skip to content

Commit

Permalink
Scoped labels: don't require holding alt key to remove (go-gitea#23303)
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

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
3 people authored and GiteaBot committed Mar 6, 2023
1 parent d1d1530 commit 812499c
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 812499c

Please sign in to comment.