mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
* Causes the Manage Themes page to refresh if the customizer is closed after the active theme is switched. * Changes the text of the 'Save and Activate' button once the theme has been activated. * Improves the naming of the customize control settings. * Add events to customize.Loader and make callbacks more flexible. * Makes the customize-loader l10n compatible with non-admin settings. * Adds WP_Customize->is_current_theme_active(). * Minor style corrections, including jQuery.attr/prop changes. git-svn-id: https://develop.svn.wordpress.org/trunk@20802 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -18,6 +18,35 @@ 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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user