#697 and #1606 and new admin edit user UI

This commit is contained in:
Unknwon 2015-09-13 11:07:21 -04:00
parent e5ed5904c6
commit 83e747bfda
15 changed files with 183 additions and 156 deletions

View file

@ -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');
}
});
}