summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-13 11:07:21 -0400
committerUnknwon <u@gogs.io>2015-09-13 11:07:21 -0400
commit83e747bfda43c2c8fa0aceb2c989d42fe5ca1582 (patch)
tree1dfee9128010bb08ad2177c24fd1c5c8c53d45cd /public
parente5ed5904c62d9a618cb6f4ad852b021a02c3481e (diff)
downloadgitea-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.js12
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');
}
});
}