Forbid jQuery .prop and fix related issues (#29832)

The issue checkbox code received a few more cleanups and I specifically
tested it. The other changes are trivial. Also, I checked the cases for
how many elements match the jQuery selection to determine querySelector
vs. querySelectorAll.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
silverwind 2024-03-16 16:08:10 +01:00 committed by GitHub
parent cb78648ad9
commit 21fe512aac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 37 additions and 27 deletions

View file

@ -533,7 +533,7 @@ export function initRepository() {
const gitignores = $('input[name="gitignores"]').val();
const license = $('input[name="license"]').val();
if (gitignores || license) {
$('input[name="auto_init"]').prop('checked', true);
document.querySelector('input[name="auto_init"]').checked = true;
}
});
}