mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 15:34:03 +01:00
Remove jQuery class from the common admin functions (#30137)
- Switched from jQuery class functions to plain JavaScript `classList` - Tested the new authentication source form and the deletion of system notices. They work as before Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit 1551d73d3f95284965675b828e1eeceafa378437)
This commit is contained in:
parent
36ee0745cc
commit
708fdf2da9
1 changed files with 6 additions and 7 deletions
|
@ -122,7 +122,7 @@ export function initAdminCommon() {
|
||||||
input.removeAttribute('required');
|
input.removeAttribute('required');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.binddnrequired').removeClass('required');
|
document.querySelector('.binddnrequired')?.classList.remove('required');
|
||||||
|
|
||||||
const authType = this.value;
|
const authType = this.value;
|
||||||
switch (authType) {
|
switch (authType) {
|
||||||
|
@ -131,7 +131,7 @@ export function initAdminCommon() {
|
||||||
for (const input of document.querySelectorAll('.binddnrequired input, .ldap div.required:not(.dldap) input')) {
|
for (const input of document.querySelectorAll('.binddnrequired input, .ldap div.required:not(.dldap) input')) {
|
||||||
input.setAttribute('required', 'required');
|
input.setAttribute('required', 'required');
|
||||||
}
|
}
|
||||||
$('.binddnrequired').addClass('required');
|
document.querySelector('.binddnrequired')?.classList.add('required');
|
||||||
break;
|
break;
|
||||||
case '3': // SMTP
|
case '3': // SMTP
|
||||||
showElem('.smtp');
|
showElem('.smtp');
|
||||||
|
@ -234,16 +234,15 @@ export function initAdminCommon() {
|
||||||
});
|
});
|
||||||
document.getElementById('delete-selection')?.addEventListener('click', async function (e) {
|
document.getElementById('delete-selection')?.addEventListener('click', async function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const $this = $(this);
|
this.classList.add('is-loading', 'disabled');
|
||||||
$this.addClass('is-loading disabled');
|
|
||||||
const data = new FormData();
|
const data = new FormData();
|
||||||
$checkboxes.each(function () {
|
$checkboxes.each(function () {
|
||||||
if ($(this).checkbox('is checked')) {
|
if ($(this).checkbox('is checked')) {
|
||||||
data.append('ids[]', $(this).data('id'));
|
data.append('ids[]', this.getAttribute('data-id'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
await POST($this.data('link'), {data});
|
await POST(this.getAttribute('data-link'), {data});
|
||||||
window.location.href = $this.data('redirect');
|
window.location.href = this.getAttribute('data-redirect');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue