summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/common-organization.js
blob: 442714a3d676a25c9553539dce7f020e1eb63f8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import {initCompLabelEdit} from './comp/LabelEdit.js';
import {toggleElem} from '../utils/dom.js';

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');
}