diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js
index e4f249fe35..a76e86725a 100644
|
a
|
b
|
|
| 5 | 5 | /* global ajaxurl, pwsL10n, userProfileL10n */ |
| 6 | 6 | (function($) { |
| 7 | 7 | var updateLock = false, |
| | 8 | isSubmitting = false, |
| 8 | 9 | __ = wp.i18n.__, |
| 9 | 10 | $pass1Row, |
| 10 | 11 | $pass1, |
| … |
… |
|
| 15 | 16 | $submitButtons, |
| 16 | 17 | $submitButton, |
| 17 | 18 | currentPass, |
| | 19 | $form, |
| | 20 | originalFormContent, |
| 18 | 21 | $passwordWrapper; |
| 19 | 22 | |
| 20 | 23 | function generatePassword() { |
| … |
… |
|
| 454 | 457 | |
| 455 | 458 | bindPasswordForm(); |
| 456 | 459 | bindPasswordResetLink(); |
| | 460 | $submitButtons.on( 'click', function() { |
| | 461 | isSubmitting = true; |
| | 462 | }); |
| | 463 | |
| | 464 | $form = $( '#your-profile, #createuser' ); |
| | 465 | originalFormContent = $form.serialize(); |
| 457 | 466 | }); |
| 458 | 467 | |
| 459 | 468 | $( '#destroy-sessions' ).on( 'click', function( e ) { |
| … |
… |
|
| 481 | 490 | if ( true === updateLock ) { |
| 482 | 491 | return __( 'Your new password has not been saved.' ); |
| 483 | 492 | } |
| | 493 | if( originalFormContent !== $form.serialize() && ! isSubmitting ) { |
| | 494 | return __( 'Changes that you made may not be saved.' ); |
| | 495 | } |
| 484 | 496 | } ); |
| 485 | 497 | |
| 486 | 498 | /* |