Skip to content

Commit

Permalink
Scoped labels: don't require holding alt key to remove (#23303) (#23331)
Browse files Browse the repository at this point in the history
Backport #23303

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: Brecht Van Lommel <brecht@blender.org>
  • Loading branch information
GiteaBot and brechtvl authored Mar 6, 2023
1 parent 233a399 commit af4767d
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 af4767d

Please sign in to comment.