0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-03 03:28:56 +01:00
gitea/web_src/js/features/repo-new.ts
wxiaoguang f2a6df03d9
Refactor repo legacy (#32404)
Only move code, no unnecessary logic change. (There are many problems in
old code, but changing them is not in this PR's scope)

Co-authored-by: Giteabot <teabot@gitea.io>
2024-11-03 11:00:12 +00:00

14 lines
449 B
TypeScript

import $ from 'jquery';
export function initRepoNew() {
// Repo Creation
if ($('.repository.new.repo').length > 0) {
$('input[name="gitignores"], input[name="license"]').on('change', () => {
const gitignores = $('input[name="gitignores"]').val();
const license = $('input[name="license"]').val();
if (gitignores || license) {
document.querySelector('input[name="auto_init"]').checked = true;
}
});
}
}