summaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-01-10 13:14:02 +0100
committerGitHub <noreply@github.com>2021-01-10 14:14:02 +0200
commit6b3b6f1833d07383d24d68ec220a18315ac36809 (patch)
treeaeceb687845f71a493b64c223297c0567d7f6bf5 /web_src/js
parentd989247bb08d2b8eb144e7a0edeaedfc26d08175 (diff)
downloadgitea-6b3b6f1833d07383d24d68ec220a18315ac36809.tar.gz
gitea-6b3b6f1833d07383d24d68ec220a18315ac36809.zip
Add option to change username to the admin panel (#14229)
Co-authored-by: Bwko <bouwko@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 37c31538af..07d5b99e31 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1796,6 +1796,7 @@ function initAdmin() {
if ($('.admin.new.user').length > 0 || $('.admin.edit.user').length > 0) {
$('#login_type').on('change', function () {
if ($(this).val().substring(0, 1) === '0') {
+ $('#user_name').removeAttr('disabled');
$('#login_name').removeAttr('required');
$('.non-local').hide();
$('.local').show();
@@ -1805,6 +1806,7 @@ function initAdmin() {
$('#password').attr('required', 'required');
}
} else {
+ $('#user_name').attr('disabled', 'disabled');
$('#login_name').attr('required', 'required');
$('.non-local').show();
$('.local').hide();