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

Amends [41667].
Fixes #42475 for 4.9.

Built from https://develop.svn.wordpress.org/branches/4.9@42137


git-svn-id: http://core.svn.wordpress.org/branches/4.9@41968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-11-09 04:21:40 +00:00
parent e6a91f7ccf
commit 707a3196f7
3 changed files with 7 additions and 5 deletions

View File

@ -9191,12 +9191,14 @@
api.unbind( 'change', startAutosaving ); // Ensure startAutosaving only fires once.
api.state( 'saved' ).bind( function( isSaved ) {
function onChangeSaved( isSaved ) {
if ( ! isSaved && ! api.settings.changeset.autosaved ) {
api.settings.changeset.autosaved = true; // Once a change is made then autosaving kicks in.
api.previewer.send( 'autosaving' );
}
} );
}
api.state( 'saved' ).bind( onChangeSaved );
onChangeSaved( api.state( 'saved' ).get() );
/**
* Request changeset update and then re-schedule the next changeset update time.

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-RC2-42135';
$wp_version = '4.9-RC2-42137';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.