Changeset 31697
- Timestamp:
- 03/10/2015 03:55:28 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/themes.css
r31579 r31697 1353 1353 } 1354 1354 1355 #customize-preview.wp-full-overlay-main { 1356 background: url(../images/spinner.gif) no-repeat center center; 1357 -webkit-background-size: 20px 20px; 1358 background-size: 20px 20px; 1359 } 1360 1361 #customize-preview.wp-full-overlay-main.iframe-ready { 1362 background: none; 1363 } 1364 1355 1365 .wp-full-overlay-sidebar .wp-full-overlay-header { 1356 1366 position: absolute; … … 1711 1721 } 1712 1722 1723 #customize-preview.wp-full-overlay-main, 1713 1724 .customize-loading #customize-container, 1714 1725 .theme-install-overlay .wp-full-overlay-main { -
trunk/src/wp-admin/js/customize-controls.js
r31661 r31697 1915 1915 1916 1916 this.bind( 'ready', function ( data ) { 1917 1918 this.container.addClass( 'iframe-ready' ); 1919 1917 1920 if ( ! data ) { 1918 1921 return; … … 2218 2221 var self = this; 2219 2222 2223 // Display loading indicator 2224 this.send( 'loading-initiated' ); 2225 2220 2226 this.abort(); 2221 2227 … … 2250 2256 2251 2257 this.loading.fail( function( reason, location ) { 2252 if ( 'redirect' === reason && location ) 2258 self.send( 'loading-failed' ); 2259 if ( 'redirect' === reason && location ) { 2253 2260 self.previewUrl( location ); 2261 } 2254 2262 2255 2263 if ( 'logged out' === reason ) { … … 2262 2270 } 2263 2271 2264 if ( 'cheatin' === reason ) 2272 if ( 'cheatin' === reason ) { 2265 2273 self.cheatin(); 2274 } 2266 2275 }); 2267 2276 }, -
trunk/src/wp-includes/class-wp-customize-manager.php
r31540 r31697 502 502 add_action( 'wp_head', array( $this, 'customize_preview_base' ) ); 503 503 add_action( 'wp_head', array( $this, 'customize_preview_html5' ) ); 504 add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) ); 504 505 add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 ); 505 506 add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 ); … … 544 545 545 546 /** 546 * Print a workaround to handle HTML5 tags in IE < 9 547 * Print a workaround to handle HTML5 tags in IE < 9. 547 548 * 548 549 * @since 3.4.0 … … 562 563 563 564 /** 565 * Print CSS for loading indicators for the Customizer preview. 566 * 567 * @since 4.2.0 568 */ 569 public function customize_preview_loading_style() { 570 ?><style> 571 body.wp-customizer-unloading { 572 opacity: 0.25; 573 cursor: progress !important; 574 -webkit-transition: opacity 0.5s; 575 transition: opacity 0.5s; 576 } 577 body.wp-customizer-unloading * { 578 pointer-events: none !important; 579 } 580 </style><?php 581 } 582 583 /** 564 584 * Print JavaScript settings for preview frame. 565 585 * … … 573 593 'activeSections' => array(), 574 594 'activeControls' => array(), 595 'l10n' => array( 596 'loading' => __( 'Loading ...' ), 597 ), 575 598 ); 576 599 -
trunk/src/wp-includes/js/customize-preview.js
r30891 r31697 116 116 } ); 117 117 118 // Display a loading indicator when preview is reloading, and remove on failure. 119 api.preview.bind( 'loading-initiated', function () { 120 $( 'body' ).addClass( 'wp-customizer-unloading' ); 121 $( 'html' ).prop( 'title', api.settings.l10n.loading ); 122 }); 123 api.preview.bind( 'loading-failed', function () { 124 $( 'body' ).removeClass( 'wp-customizer-unloading' ); 125 $( 'html' ).prop( 'title', '' ); 126 }); 127 118 128 /* Custom Backgrounds */ 119 129 bg = $.map(['color', 'image', 'position_x', 'repeat', 'attachment'], function( prop ) {
Note: See TracChangeset
for help on using the changeset viewer.