Customize: Prevent showing confirmation dialog when leaving Customizer after previewing theme switch without making any changes.

Fixes #42173.

Built from https://develop.svn.wordpress.org/trunk@41845


git-svn-id: http://core.svn.wordpress.org/trunk@41679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-10-12 05:17:49 +00:00
parent af83fe7fb9
commit 39a2308a94
3 changed files with 11 additions and 2 deletions

View File

@ -8384,6 +8384,15 @@
var isInsideIframe = false;
function isCleanState() {
/*
* Handle special case of previewing theme switch since some settings (for nav menus and widgets)
* are pre-dirty and non-active themes can only ever be auto-drafts.
*/
if ( ! api.state( 'activated' ).get() ) {
return 0 === api._latestRevision;
}
return api.state( 'saved' ).get() && 'auto-draft' !== api.state( 'changesetStatus' ).get();
}

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-beta1-41844';
$wp_version = '4.9-beta1-41845';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.