diff options
author | Unknwon <u@gogs.io> | 2015-09-13 11:07:21 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-13 11:07:21 -0400 |
commit | 83e747bfda43c2c8fa0aceb2c989d42fe5ca1582 (patch) | |
tree | 1dfee9128010bb08ad2177c24fd1c5c8c53d45cd /public | |
parent | e5ed5904c62d9a618cb6f4ad852b021a02c3481e (diff) | |
download | gitea-83e747bfda43c2c8fa0aceb2c989d42fe5ca1582.tar.gz gitea-83e747bfda43c2c8fa0aceb2c989d42fe5ca1582.zip |
#697 and #1606 and new admin edit user UI
Diffstat (limited to 'public')
-rw-r--r-- | public/js/gogs.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 49011dbf2e..0b20592397 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -458,20 +458,26 @@ function initAdmin() { } // New user - if ($('.admin.new.user').length > 0) { + if ($('.admin.new.user').length > 0 || + $('.admin.edit.user').length > 0) { $('#login_type').change(function () { if ($(this).val().substring(0, 1) == '0') { $('#login_name').removeAttr('required'); - $('#password').attr('required', 'required'); $('.non-local').hide(); $('.local').show(); $('#user_name').focus(); + + if($(this).data('password')=="required"){ + $('#password').attr('required', 'required'); + } + } else { $('#login_name').attr('required', 'required'); - $('#password').removeAttr('required'); $('.non-local').show(); $('.local').hide(); $('#login_name').focus(); + + $('#password').removeAttr('required'); } }); } |