mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-25 17:44:32 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			595 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			595 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import {initCompLabelEdit} from './comp/LabelEdit.ts';
 | |
| import {toggleElem} from '../utils/dom.ts';
 | |
| 
 | |
| export function initCommonOrganization() {
 | |
|   if (!document.querySelectorAll('.organization').length) {
 | |
|     return;
 | |
|   }
 | |
| 
 | |
|   document.querySelector<HTMLInputElement>('.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('.page-content.organization.settings.labels');
 | |
| }
 |