Make WordPress Core

Ticket #37032: 37032.1.diff

File 37032.1.diff, 1.0 KB (added by westonruter, 9 years ago)
  • src/wp-includes/js/customize-selective-refresh.js

    diff --git src/wp-includes/js/customize-selective-refresh.js src/wp-includes/js/customize-selective-refresh.js
    index 7efee3d..9a11b24 100644
     
    22
    33wp.customize.selectiveRefresh = ( function( $, api ) {
    44        'use strict';
    5         var self, Partial, Placement;
     5        var self, Partial, Placement, active = false;
    66
    77        self = {
    88                ready: $.Deferred(),
    wp.customize.selectiveRefresh = ( function( $, api ) { 
    779779                 */
    780780                handleSettingChange = function( newValue, oldValue ) {
    781781                        var setting = this;
     782                        if ( ! active ) {
     783                                return;
     784                        }
    782785                        self.partial.each( function( partial ) {
    783786                                if ( partial.isRelatedSetting( setting, newValue, oldValue ) ) {
    784787                                        partial.refresh();
    wp.customize.selectiveRefresh = ( function( $, api ) { 
    848851                } );
    849852
    850853                api.preview.bind( 'active', function() {
     854                        active = true;
    851855
    852856                        // Make all partials ready.
    853857                        self.partial.each( function( partial ) {