gitea/web_src/js/features/common-organization.ts
wxiaoguang 96d3a03a08
Refactor LabelEdit (#32752)
And fix a regression:
https://github.com/go-gitea/gitea/pull/30053#discussion_r1874405470

Major changes:

* rewrite without jquery
* remove the "delete modal", using "link-action" is good enough
* merge "new modal" and "edit modal"
2024-12-08 02:35:28 +00:00

17 lines
577 B
TypeScript

import {initCompLabelEdit} from './comp/LabelEdit.ts';
import {toggleElem} from '../utils/dom.ts';
export function initCommonOrganization() {
if (!document.querySelectorAll('.organization').length) {
return;
}
document.querySelector('.organization.settings.options #org_name')?.addEventListener('input', function () {
const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name').toLowerCase();
toggleElem('#org-name-change-prompt', nameChanged);
});
// Labels
initCompLabelEdit('.page-content.organization.settings.labels');
}