Make WordPress Core

Changeset 42137


Ignore:
Timestamp:
11/09/2017 04:20:18 AM (7 years ago)
Author:
westonruter
Message:

Customize: Ensure autosaving message gets sent to preview after initial change when saved state is first dirty.

Amends [41667].
Fixes #42475 for 4.9.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/js/customize-controls.js

    r42122 r42137  
    91929192            api.unbind( 'change', startAutosaving ); // Ensure startAutosaving only fires once.
    91939193
    9194             api.state( 'saved' ).bind( function( isSaved ) {
     9194            function onChangeSaved( isSaved ) {
    91959195                if ( ! isSaved && ! api.settings.changeset.autosaved ) {
    91969196                    api.settings.changeset.autosaved = true; // Once a change is made then autosaving kicks in.
    91979197                    api.previewer.send( 'autosaving' );
    91989198                }
    9199             } );
     9199            }
     9200            api.state( 'saved' ).bind( onChangeSaved );
     9201            onChangeSaved( api.state( 'saved' ).get() );
    92009202
    92019203            /**
Note: See TracChangeset for help on using the changeset viewer.