mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-26 19:56:11 +01:00
3d3c740636
Backport #24161 by @wxiaoguang ## 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 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
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');
|
|
}
|