mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-14 16:49:19 +08:00
5902372e63
- Switched to plain JavaScript - Tested the organization rename prompt toggling functionality and it works as before # Demo using JavaScript without jQuery ![action](https://github.com/go-gitea/gitea/assets/20454870/e6f641b0-aa46-4b85-9693-0d608cca855e) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
19 lines
629 B
JavaScript
19 lines
629 B
JavaScript
import {initCompLabelEdit} from './comp/LabelEdit.js';
|
|
import {toggleElem} from '../utils/dom.js';
|
|
|
|
export function initCommonOrganization() {
|
|
if (!document.querySelectorAll('.organization').length) {
|
|
return;
|
|
}
|
|
|
|
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();
|
|
toggleElem('#org-name-change-prompt', nameChanged);
|
|
});
|
|
|
|
// Labels
|
|
initCompLabelEdit('.organization.settings.labels');
|
|
}
|