Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jQuery class from the common admin functions #30137

Merged
merged 3 commits into from Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 6 additions & 7 deletions web_src/js/features/admin/common.js
Expand Up @@ -122,7 +122,7 @@ export function initAdminCommon() {
input.removeAttribute('required');
}

$('.binddnrequired').removeClass('required');
document.querySelector('.binddnrequired')?.classList.remove('required');

const authType = this.value;
switch (authType) {
Expand All @@ -131,7 +131,7 @@ export function initAdminCommon() {
for (const input of document.querySelectorAll('.binddnrequired input, .ldap div.required:not(.dldap) input')) {
input.setAttribute('required', 'required');
}
$('.binddnrequired').addClass('required');
document.querySelector('.binddnrequired')?.classList.add('required');
break;
case '3': // SMTP
showElem('.smtp');
Expand Down Expand Up @@ -234,16 +234,15 @@ export function initAdminCommon() {
});
document.getElementById('delete-selection')?.addEventListener('click', async function (e) {
e.preventDefault();
const $this = $(this);
$this.addClass('is-loading disabled');
this.classList.add('is-loading', 'disabled');
const data = new FormData();
$checkboxes.each(function () {
if ($(this).checkbox('is checked')) {
data.append('ids[]', $(this).data('id'));
data.append('ids[]', this.getAttribute('data-id'));
}
});
await POST($this.data('link'), {data});
window.location.href = $this.data('redirect');
await POST(this.getAttribute('data-link'), {data});
window.location.href = this.getAttribute('data-redirect');
});
}
}