1
0
Fork 0
forked from forgejo/forgejo

Forbid jQuery is and fix issues (#30016)

Tested all functionality.

---------

Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 0a2f973de9b681a472c96bdfcd945978e88458d8)
This commit is contained in:
silverwind 2024-03-24 18:56:02 +01:00 committed by Earl Warren
parent c5eae64e06
commit e28f4328b3
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
5 changed files with 9 additions and 9 deletions

View file

@ -139,7 +139,7 @@ export function initRepoCommentForm() {
hasUpdateAction = $listMenu.data('action') === 'update'; // Update the var
const $clickedItem = $(this);
const clickedItem = this; // eslint-disable-line unicorn/no-this-assignment
const scope = $(this).attr('data-scope');
$(this).parent().find('.item').each(function () {
@ -148,10 +148,10 @@ export function initRepoCommentForm() {
if ($(this).attr('data-scope') !== scope) {
return true;
}
if (!$(this).is($clickedItem) && !$(this).hasClass('checked')) {
if (this !== clickedItem && !$(this).hasClass('checked')) {
return true;
}
} else if (!$(this).is($clickedItem)) {
} else if (this !== clickedItem) {
// Toggle for other labels
return true;
}