2021-10-17 01:28:04 +08:00
|
|
|
import {initCompLabelEdit} from './comp/LabelEdit.js';
|
2023-04-17 23:35:57 +08:00
|
|
|
import {toggleElem} from '../utils/dom.js';
|
2021-10-17 01:28:04 +08:00
|
|
|
|
|
|
|
export function initCommonOrganization() {
|
2024-02-16 23:48:01 +08:00
|
|
|
if (!document.querySelectorAll('.organization').length) {
|
2021-10-17 01:28:04 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-02-16 23:48:01 +08:00
|
|
|
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();
|
2023-04-17 23:35:57 +08:00
|
|
|
toggleElem('#org-name-change-prompt', nameChanged);
|
|
|
|
});
|
2021-10-17 01:28:04 +08:00
|
|
|
|
|
|
|
// Labels
|
|
|
|
initCompLabelEdit('.organization.settings.labels');
|
|
|
|
}
|