diff --git src/wp-includes/js/customize-preview-nav-menus.js src/wp-includes/js/customize-preview-nav-menus.js
index 6745b41be8..5aa9e3d104 100644
|
|
wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function( |
21 | 21 | * Keep track of whether we synced to determine whether or not bindSettingListener |
22 | 22 | * should also initially fire the listener. This initial firing needs to wait until |
23 | 23 | * 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. |
27 | 26 | */ |
28 | | api.preview.bind( 'sync', function() { |
| 27 | api.preview.bind( 'active', function() { |
29 | 28 | synced = true; |
30 | 29 | } ); |
31 | 30 | |
diff --git src/wp-includes/js/customize-selective-refresh.js src/wp-includes/js/customize-selective-refresh.js
index 4c4fa0d9cf..fedc82390d 100644
|
|
wp.customize.selectiveRefresh = ( function( $, api ) { |
967 | 967 | setting.unbind( handleSettingChange ); |
968 | 968 | }; |
969 | 969 | |
970 | | api.bind( 'add', watchSettingChange ); |
| 970 | api.preview.bind( 'sync', function( events ) { |
| 971 | api.bind( 'add', watchSettingChange ); |
| 972 | |
| 973 | // Capture the settings that were modified during loading to trigger change events to trigger selective refresh. |
| 974 | if ( events['settings-modified-while-loading'] ) { |
| 975 | _.each( _.keys( events['settings-modified-while-loading'] ), function( settingId ) { |
| 976 | var setting = api( settingId ); |
| 977 | if ( setting ) { |
| 978 | handleSettingChange.call( setting, setting(), setting() ); |
| 979 | } |
| 980 | } ); |
| 981 | } |
| 982 | } ); |
971 | 983 | api.bind( 'remove', unwatchSettingChange ); |
972 | 984 | api.each( function( setting ) { |
973 | 985 | setting.bind( handleSettingChange ); |