mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-21 05:21:26 +08:00
f20057271d
## Before * The renaming detection is wrong (eg: pasting a new name into the input doesn't trigger the detection) * The renaming prompt layout is not good * Some MaxSize/maxlength rules is missing ![image](https://user-images.githubusercontent.com/2114189/232379191-5d0f6d10-56ca-4cec-ac52-7f77b9cb4a8a.png) ![image](https://user-images.githubusercontent.com/2114189/232379234-3289373b-9ddb-4627-ae86-f4d74589fa0c.png) ## After * Fix these problems ![image](https://user-images.githubusercontent.com/2114189/232379098-31c6fa21-c210-4e7f-a337-b38b99670835.png)
18 lines
531 B
JavaScript
18 lines
531 B
JavaScript
import $ from 'jquery';
|
|
import {initCompLabelEdit} from './comp/LabelEdit.js';
|
|
import {toggleElem} from '../utils/dom.js';
|
|
|
|
export function initCommonOrganization() {
|
|
if ($('.organization').length === 0) {
|
|
return;
|
|
}
|
|
|
|
$('.organization.settings.options #org_name').on('input', function () {
|
|
const nameChanged = $(this).val().toLowerCase() !== $(this).attr('data-org-name').toLowerCase();
|
|
toggleElem('#org-name-change-prompt', nameChanged);
|
|
});
|
|
|
|
// Labels
|
|
initCompLabelEdit('.organization.settings.labels');
|
|
}
|