mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
Customizer: Add loading indicators for the Customizer preview.
props Fab1en, westonruter. fixes #31196. git-svn-id: https://develop.svn.wordpress.org/trunk@31697 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -501,6 +501,7 @@ final class WP_Customize_Manager {
|
||||
add_action( 'wp', array( $this, 'customize_preview_override_404_status' ) );
|
||||
add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
|
||||
add_action( 'wp_head', array( $this, 'customize_preview_html5' ) );
|
||||
add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );
|
||||
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
|
||||
add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
|
||||
add_filter( 'wp_die_handler', array( $this, 'remove_preview_signature' ) );
|
||||
@@ -543,7 +544,7 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a workaround to handle HTML5 tags in IE < 9
|
||||
* Print a workaround to handle HTML5 tags in IE < 9.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
@@ -560,6 +561,25 @@ final class WP_Customize_Manager {
|
||||
<![endif]--><?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Print CSS for loading indicators for the Customizer preview.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*/
|
||||
public function customize_preview_loading_style() {
|
||||
?><style>
|
||||
body.wp-customizer-unloading {
|
||||
opacity: 0.25;
|
||||
cursor: progress !important;
|
||||
-webkit-transition: opacity 0.5s;
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
body.wp-customizer-unloading * {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
</style><?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Print JavaScript settings for preview frame.
|
||||
*
|
||||
@@ -572,6 +592,9 @@ final class WP_Customize_Manager {
|
||||
'activePanels' => array(),
|
||||
'activeSections' => array(),
|
||||
'activeControls' => array(),
|
||||
'l10n' => array(
|
||||
'loading' => __( 'Loading ...' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( 2 == $this->nonce_tick ) {
|
||||
|
||||
Reference in New Issue
Block a user