Make WordPress Core


Ignore:
Timestamp:
03/10/2015 03:55:28 PM (12 years ago)
Author:
ocean90
Message:

Customizer: Add loading indicators for the Customizer preview.

props Fab1en, westonruter.
fixes #31196.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r31540 r31697  
    502502                add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
    503503                add_action( 'wp_head', array( $this, 'customize_preview_html5' ) );
     504                add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) );
    504505                add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
    505506                add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
    … …  
    544545
    545546        /**
    546          * Print a workaround to handle HTML5 tags in IE < 9
     547         * Print a workaround to handle HTML5 tags in IE < 9.
    547548         *
    548549         * @since 3.4.0
    … …  
    562563
    563564        /**
     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        /**
    564584         * Print JavaScript settings for preview frame.
    565585         *
    … …  
    573593                        'activeSections' => array(),
    574594                        'activeControls' => array(),
     595                        'l10n' => array(
     596                                'loading'  => __( 'Loading ...' ),
     597                        ),
    575598                );
    576599
Note: See TracChangeset for help on using the changeset viewer.