Profile: when clicking "Cancel" after clicking "Generate Password", request and generate a new password to present to the user.

Props adamsilverstein, wonderboymusic.
Fixes #33450.

Built from https://develop.svn.wordpress.org/trunk@34312


git-svn-id: http://core.svn.wordpress.org/trunk@34276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2015-09-18 20:14:24 +00:00
parent abefb963e7
commit c43f72fbfb
5 changed files with 21 additions and 3 deletions
+9
View File
@@ -217,6 +217,15 @@
$cancelButton.on( 'click', function () {
updateLock = false;
// Clear any entered password.
$pass1Text.val( '' );
// Generate a new password.
wp.ajax.post( 'generate-password' )
.done( function( data ) {
$pass1.data( 'pw', data );
} );
$generateButton.show();
$passwordWrapper.hide();