mirror of
https://github.com/go-gitea/gitea.git
synced 2025-02-20 13:35:48 +01:00
Remove jQuery from organization rename prompt toggle (#29195)
- Switched to plain JavaScript - Tested the organization rename prompt toggling functionality and it works as before # Demo using JavaScript without jQuery  --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
45c15387b2
commit
5902372e63
@ -1,14 +1,15 @@
|
||||
import $ from 'jquery';
|
||||
import {initCompLabelEdit} from './comp/LabelEdit.js';
|
||||
import {toggleElem} from '../utils/dom.js';
|
||||
|
||||
export function initCommonOrganization() {
|
||||
if ($('.organization').length === 0) {
|
||||
if (!document.querySelectorAll('.organization').length) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('.organization.settings.options #org_name').on('input', function () {
|
||||
const nameChanged = $(this).val().toLowerCase() !== $(this).attr('data-org-name').toLowerCase();
|
||||
const orgNameInput = document.querySelector('.organization.settings.options #org_name');
|
||||
if (!orgNameInput) return;
|
||||
orgNameInput.addEventListener('input', function () {
|
||||
const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name').toLowerCase();
|
||||
toggleElem('#org-name-change-prompt', nameChanged);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user