WordPress.org

Make WordPress Core

Changeset 38494


Ignore:
Timestamp:
09/01/2016 12:23:50 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Users: After [33766], don't reset the password when clicking "Show Password" and then "Cancel" on Add New User screen.

Props smerriman for reporting.
Fixes #37902. See #33419.

File:
1 edited

Legend:

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

    r37940 r38494  
    261261            resetToggle();
    262262
    263             // Clear password field to prevent update
    264             $pass1.val( '' ).trigger( 'pwupdate' );
    265             $submitButtons.prop( 'disabled', false );
     263            if ( $pass1Row.closest( 'form' ).is( '#your-profile' ) ) {
     264                // Clear password field to prevent update
     265                $pass1.val( '' ).trigger( 'pwupdate' );
     266                $submitButtons.prop( 'disabled', false );
     267            }
    266268        } );
    267269
    268         $pass1Row.closest('form').on( 'submit', function () {
     270        $pass1Row.closest( 'form' ).on( 'submit', function () {
    269271            updateLock = false;
    270272
Note: See TracChangeset for help on using the changeset viewer.