From d76aec25dd3ef0e3797dff59edb8ba6c78312167 Mon Sep 17 00:00:00 2001 From: westi Date: Fri, 20 Jun 2008 15:28:22 +0000 Subject: [PATCH] Update nickname in display name dropdown dynamically. Fixes #5691 props hansengel. git-svn-id: http://svn.automattic.com/wordpress/trunk@8135 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/user-edit.php | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 73a98773c4..c9828469a9 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -41,6 +41,18 @@ function profile_js ( ) { } } + + function update_nickname ( ) { + + var nickname = jQuery('#nickname').val(); + var display_nickname = jQuery('#display_nickname').val(); + + if ( nickname == '' ) { + jQuery('#display_nickname').remove(); + } + jQuery('#display_nickname').val(nickname).html(nickname); + + } jQuery(function($) { $('#pass1').keyup( check_pass_strength ) @@ -49,6 +61,7 @@ function profile_js ( ) { jQuery(document).ready( function() { jQuery('#pass1,#pass2').attr('autocomplete','off'); + jQuery('#nickname').blur(update_nickname); }); ';