Make WordPress Core

Changeset 34061


Ignore:
Timestamp:
09/11/2015 10:51:17 PM (11 years ago)
Author:
azaozz
Message:

Settings: reassign the label when switching password fields so it always highlights the visible field.

Props umesh.nevase.
Fixes #33778 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/user-profile.js

    r34060 r34061  
    77                $pass1,
    88                $pass1Text,
     9                $pass1Label,
    910                $pass2,
    1011                $weakRow,
    … …  
    117118                                $pass1Text.focus();
    118119
     120                                $pass1Label.attr( 'for', 'pass1-text' );
     121
    119122                                if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) {
    120123                                        $pass1Text[0].setSelectionRange( 0, 100 );
    … …  
    136139                                $pass1.focus();
    137140
     141                                $pass1Label.attr( 'for', 'pass1' );
     142
    138143                                if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) {
    139144                                        $pass1[0].setSelectionRange( 0, 100 );
    … …  
    149154
    150155                $pass1Row = $('.user-pass1-wrap');
     156                $pass1Label = $pass1Row.find('th label');
     157
    151158                // hide this
    152159                $('.user-pass2-wrap').hide();
Note: See TracChangeset for help on using the changeset viewer.