From 504d75e4c1e9a42253cba2c40a634974c314f88d Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 11 Sep 2015 22:51:17 +0000 Subject: [PATCH] Settings: reassign the label when switching password fields so it always highlights the visible field. Props umesh.nevase. Fixes #33778 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@34061 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/user-profile.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wp-admin/js/user-profile.js b/src/wp-admin/js/user-profile.js index 622e09c56d..a7ceeefd26 100644 --- a/src/wp-admin/js/user-profile.js +++ b/src/wp-admin/js/user-profile.js @@ -6,6 +6,7 @@ $pass1Wrap, $pass1, $pass1Text, + $pass1Label, $pass2, $weakRow, $weakCheckbox, @@ -116,6 +117,8 @@ $pass1Text.focus(); + $pass1Label.attr( 'for', 'pass1-text' ); + if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) { $pass1Text[0].setSelectionRange( 0, 100 ); } @@ -135,6 +138,8 @@ $pass1.focus(); + $pass1Label.attr( 'for', 'pass1' ); + if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) { $pass1[0].setSelectionRange( 0, 100 ); } @@ -148,6 +153,8 @@ $cancelButton; $pass1Row = $('.user-pass1-wrap'); + $pass1Label = $pass1Row.find('th label'); + // hide this $('.user-pass2-wrap').hide();