diff options
author | Yarden Shoham <git@yardenshoham.com> | 2024-03-27 18:14:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-27 16:14:18 +0000 |
commit | 1551d73d3f95284965675b828e1eeceafa378437 (patch) | |
tree | d5af112105c36daa6fe72e70c999083534f85d47 /web_src/js | |
parent | 1a71dbfb7881f65d39b689a5be26cc94afefb10f (diff) | |
download | gitea-1551d73d3f95284965675b828e1eeceafa378437.tar.gz gitea-1551d73d3f95284965675b828e1eeceafa378437.zip |
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>
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/admin/common.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/web_src/js/features/admin/common.js b/web_src/js/features/admin/common.js index ac8bfe8b34..8a88996742 100644 --- a/web_src/js/features/admin/common.js +++ b/web_src/js/features/admin/common.js @@ -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) { @@ -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'); @@ -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'); }); } } |