0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-24 18:43:04 +01:00
gitea/web_src/js/features/common-organization.ts

17 lines
564 B
TypeScript
Raw Normal View History

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('.organization.settings.labels');
}