Theme Customizer: Improve activate and publish flow, make customizer states easier to track. fixes #20743, see #19910.

git-svn-id: https://develop.svn.wordpress.org/trunk@20899 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-05-25 17:42:06 +00:00
parent 53d8ab60ec
commit d49df83c8c
4 changed files with 70 additions and 44 deletions
-29
View File
@@ -18,35 +18,6 @@ jQuery( function($) {
});
});
/**
* Theme Customizer
*
* Ensures the themes page is refreshed if the customizer switches the theme.
*/
jQuery( function($) {
var Loader, activated;
if ( typeof wp === 'undefined' || ! wp.customize || ! ( Loader = wp.customize.Loader ) )
return;
// Strip the current URL of its query string and hash, add activated query string.
activated = window.location.href.replace(/[#?].*$/, '') + '?activated=true';
// When an instance of the customizer is loaded...
Loader.bind( 'open', function() {
// If the customizer triggers a theme switched event,
// load the activated page when the customizer is closed.
Loader.messenger.bind( 'switched', function() {
Loader.unbind( 'close', Loader.overlay.hide );
Loader.bind( 'close', function() {
window.location = activated;
});
});
});
});
/**
* Theme Install
*