Add New User screen: don't bind to blur event on the user_name fields when the <select> doesn't exist, props SergeyBiryukov, fixes #20392
git-svn-id: http://svn.automattic.com/wordpress/trunk@20431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
000b7a9313
commit
31b26e343a
|
@ -30,18 +30,18 @@
|
|||
}
|
||||
|
||||
$(document).ready( function() {
|
||||
var select = $('#display_name');
|
||||
|
||||
$('#pass1').val('').keyup( check_pass_strength );
|
||||
$('#pass2').val('').keyup( check_pass_strength );
|
||||
$('#pass-strength-result').show();
|
||||
$('.color-palette').click(function(){$(this).siblings('input[name="admin_color"]').prop('checked', true)});
|
||||
$('#first_name, #last_name, #nickname').blur(function(){
|
||||
var select = $('#display_name'), current, dub = [], inputs;
|
||||
|
||||
if ( !select.length )
|
||||
return;
|
||||
|
||||
current = select.find('option:selected').attr('id');
|
||||
$('.color-palette').click( function() {
|
||||
$(this).siblings('input[name="admin_color"]').prop('checked', true);
|
||||
});
|
||||
|
||||
if ( select.length ) {
|
||||
$('#first_name, #last_name, #nickname').bind( 'blur.user_profile', function() {
|
||||
var current = select.find('option:selected').attr('id'), dub = [],
|
||||
inputs = {
|
||||
display_nickname : $('#nickname').val() || '',
|
||||
display_username : $('#user_login').val() || '',
|
||||
|
@ -71,6 +71,7 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
Loading…
Reference in New Issue