summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/common-organization.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--web_src/js/features/common-organization.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/web_src/js/features/common-organization.js b/web_src/js/features/common-organization.js
new file mode 100644
index 0000000..442714a
--- /dev/null
+++ b/web_src/js/features/common-organization.js
@@ -0,0 +1,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');
+}