|
534 | 534 | */ |
535 | 535 | autoSaveEditBox: function() { |
536 | 536 | var snapshot = this, update, |
537 | | - delay = 2000, status, isValidChangesetStatus; |
| 537 | + delay = 2000, status, isValidChangesetStatus, needConfirm; |
538 | 538 |
|
539 | 539 | snapshot.updatePending = false; |
540 | 540 | snapshot.dirtyEditControlValues = false; |
|
580 | 580 | return _.contains( [ 'future', 'pending', 'draft' ], api.state( 'changesetStatus' ).get() ); |
581 | 581 | }; |
582 | 582 |
|
| 583 | + needConfirm = function() { |
| 584 | + return snapshot.statusButton.button.data( 'confirm-text' ) === snapshot.statusButton.buttonText.get(); |
| 585 | + }; |
| 586 | + |
583 | 587 | api.bind( 'changeset-save', function() { |
584 | 588 | if ( isValidChangesetStatus() ) { |
585 | 589 | snapshot.updatePending = true; |
586 | | - snapshot.statusButton.disable( true ); |
587 | | - snapshot.spinner.addClass( 'is-active' ); |
| 590 | + if ( ! needConfirm() ) { |
| 591 | + snapshot.statusButton.disable( true ); |
| 592 | + snapshot.spinner.addClass( 'is-active' ); |
| 593 | + } |
588 | 594 | if ( snapshot.submitButton ) { |
589 | 595 | snapshot.submitButton.prop( 'disabled', true ); |
590 | 596 | } |
|
597 | 603 |
|
598 | 604 | if ( isValidChangesetStatus() ) { |
599 | 605 | snapshot.updatePending = false; |
600 | | - snapshot.statusButton.disableSelect.set( false ); |
601 | | - snapshot.spinner.removeClass( 'is-active' ); |
602 | | - snapshot.statusButton.updateButtonText( 'alt-text' ); |
| 606 | + if ( ! needConfirm() ) { |
| 607 | + snapshot.statusButton.disableSelect.set( false ); |
| 608 | + snapshot.spinner.removeClass( 'is-active' ); |
| 609 | + snapshot.statusButton.updateButtonText( 'alt-text' ); |
| 610 | + } |
603 | 611 | } |
604 | 612 | }); |
605 | 613 | }, |
|
0 commit comments