2024-07-07 17:32:30 +02:00
|
|
|
import {initCompLabelEdit} from './comp/LabelEdit.ts';
|
|
|
|
import {toggleElem} from '../utils/dom.ts';
|
2021-10-16 19:28:04 +02:00
|
|
|
|
|
|
|
export function initCommonOrganization() {
|
2024-02-16 16:48:01 +01:00
|
|
|
if (!document.querySelectorAll('.organization').length) {
|
2021-10-16 19:28:04 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-02-16 17:03:52 +01:00
|
|
|
document.querySelector('.organization.settings.options #org_name')?.addEventListener('input', function () {
|
2024-02-16 16:48:01 +01:00
|
|
|
const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name').toLowerCase();
|
2023-04-17 17:35:57 +02:00
|
|
|
toggleElem('#org-name-change-prompt', nameChanged);
|
|
|
|
});
|
2021-10-16 19:28:04 +02:00
|
|
|
|
|
|
|
// Labels
|
2024-12-08 03:35:28 +01:00
|
|
|
initCompLabelEdit('.page-content.organization.settings.labels');
|
2021-10-16 19:28:04 +02:00
|
|
|
}
|