2022-01-29 02:30:11 +05:30
|
|
|
import $ from 'jquery';
|
2021-10-16 22:58:04 +05:30
|
|
|
import {initCompLabelEdit} from './comp/LabelEdit.js';
|
2023-02-19 09:36:14 +05:30
|
|
|
import {hideElem, showElem} from '../utils/dom.js';
|
2021-10-16 22:58:04 +05:30
|
|
|
|
|
|
|
export function initCommonOrganization() {
|
|
|
|
if ($('.organization').length === 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($('.organization.settings.options').length > 0) {
|
|
|
|
$('#org_name').on('keyup', function () {
|
|
|
|
const $prompt = $('#org-name-change-prompt');
|
|
|
|
const $prompt_redirect = $('#org-name-change-redirect-prompt');
|
|
|
|
if ($(this).val().toString().toLowerCase() !== $(this).data('org-name').toString().toLowerCase()) {
|
2023-02-19 09:36:14 +05:30
|
|
|
showElem($prompt);
|
|
|
|
showElem($prompt_redirect);
|
2021-10-16 22:58:04 +05:30
|
|
|
} else {
|
2023-02-19 09:36:14 +05:30
|
|
|
hideElem($prompt);
|
|
|
|
hideElem($prompt_redirect);
|
2021-10-16 22:58:04 +05:30
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Labels
|
|
|
|
initCompLabelEdit('.organization.settings.labels');
|
|
|
|
}
|