WordPress.org

Make WordPress Core

Ticket #39099: 39099.0.diff

File 39099.0.diff, 1.7 KB (added by westonruter, 4 years ago)
  • src/wp-includes/js/customize-preview-nav-menus.js

    diff --git src/wp-includes/js/customize-preview-nav-menus.js src/wp-includes/js/customize-preview-nav-menus.js
    index 27c5251..754e5ec 100644
    wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function( 
    2121                 * Keep track of whether we synced to determine whether or not bindSettingListener
    2222                 * should also initially fire the listener. This initial firing needs to wait until
    2323                 * after all of the settings have been synced from the pane in order to prevent
    24                  * an infinite selective fallback-refresh. Note that this sync handler will be
    25                  * added after the sync handler in customize-preview.js, so it will be triggered
    26                  * after all of the settings are added.
     24                 * an infinite selective fallback-refresh. Note that the active message is sent
     25                 * from the controls once the synced message is sent from the preview.
    2726                 */
    28                 api.preview.bind( 'sync', function() {
     27                api.preview.bind( 'active', function() {
    2928                        synced = true;
    3029                } );
    3130
  • 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 f6dfa0b..3e6cb7e 100644
    wp.customize.selectiveRefresh = ( function( $, api ) { 
    951951                        setting.unbind( handleSettingChange );
    952952                };
    953953
    954                 api.bind( 'add', watchSettingChange );
     954                api.preview.bind( 'sync', function() {
     955                        api.bind( 'add', watchSettingChange );
     956                } );
    955957                api.bind( 'remove', unwatchSettingChange );
    956958                api.each( function( setting ) {
    957959                        setting.bind( handleSettingChange );