code.gitea.io/gitea@v1.21.7/web_src/js/features/common-organization.js (about)

     1  import $ from 'jquery';
     2  import {initCompLabelEdit} from './comp/LabelEdit.js';
     3  import {toggleElem} from '../utils/dom.js';
     4  
     5  export function initCommonOrganization() {
     6    if ($('.organization').length === 0) {
     7      return;
     8    }
     9  
    10    $('.organization.settings.options #org_name').on('input', function () {
    11      const nameChanged = $(this).val().toLowerCase() !== $(this).attr('data-org-name').toLowerCase();
    12      toggleElem('#org-name-change-prompt', nameChanged);
    13    });
    14  
    15    // Labels
    16    initCompLabelEdit('.organization.settings.labels');
    17  }