Make WordPress Core

Changeset 42136 for trunk


Ignore:
Timestamp:
11/09/2017 04:14:46 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 trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r42122 r42136  
    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.