Files

17 lines
596 B
TypeScript
Raw Permalink Normal View History

import {initCompLabelEdit} from './comp/LabelEdit.ts';
import {toggleElem} from '../utils/dom.ts';
2021-10-17 01:28:04 +08:00
export function initCommonOrganization() {
if (!document.querySelectorAll('.organization').length) {
2021-10-17 01:28:04 +08:00
return;
}
2025-01-15 21:26:17 +01:00
document.querySelector<HTMLInputElement>('.organization.settings.options #org_name')?.addEventListener('input', function () {
2025-12-03 03:13:16 +01:00
const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name')!.toLowerCase();
toggleElem('#org-name-change-prompt', nameChanged);
});
2021-10-17 01:28:04 +08:00
// Labels
2024-12-08 10:35:28 +08:00
initCompLabelEdit('.page-content.organization.settings.labels');
2021-10-17 01:28:04 +08:00
}