diff --git a/wp-admin/js/user-profile.dev.js b/wp-admin/js/user-profile.dev.js
index 41991f57e9..9897f070e0 100644
--- a/wp-admin/js/user-profile.dev.js
+++ b/wp-admin/js/user-profile.dev.js
@@ -29,48 +29,49 @@
}
}
- $(document).ready(function() {
+ $(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');
-
- inputs = {
- display_nickname : $('#nickname').val() || '',
- display_username : $('#user_login').val() || '',
- display_firstname : $('#first_name').val() || '',
- display_lastname : $('#last_name').val() || ''
- };
-
- if ( inputs.display_firstname && inputs.display_lastname ) {
- inputs['display_firstlast'] = inputs.display_firstname + ' ' + inputs.display_lastname;
- inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname;
- }
-
- $('option', select).remove();
- $.each(inputs, function( id, value ) {
- if ( !value )
- return;
-
- var val = value.replace(/<\/?[a-z][^>]*>/gi, '');
-
- if ( inputs[id].length && $.inArray( val, dub ) == -1 ) {
- dub.push(val);
- $('', {
- 'id': id,
- 'text': val,
- 'selected': (id == current)
- }).appendTo( select );
- }
- });
+ $('.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() || '',
+ display_firstname : $('#first_name').val() || '',
+ display_lastname : $('#last_name').val() || ''
+ };
+
+ if ( inputs.display_firstname && inputs.display_lastname ) {
+ inputs['display_firstlast'] = inputs.display_firstname + ' ' + inputs.display_lastname;
+ inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname;
+ }
+
+ $('option', select).remove();
+ $.each(inputs, function( id, value ) {
+ if ( ! value )
+ return;
+
+ var val = value.replace(/<\/?[a-z][^>]*>/gi, '');
+
+ if ( inputs[id].length && $.inArray( val, dub ) == -1 ) {
+ dub.push(val);
+ $('', {
+ 'id': id,
+ 'text': val,
+ 'selected': (id == current)
+ }).appendTo( select );
+ }
+ });
+ });
+ }
});
})(jQuery);