Skip to content

Commit

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

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

Please sign in to comment.