Changeset 39112
- Timestamp:
- 11/03/2016 05:06:17 AM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r39010 r39112 4300 4300 4301 4301 synced.settings = api.get(); 4302 synced['settings-modified-while-loading'] = previewer.settingsModifiedWhileLoading; 4302 4303 if ( 'resolved' !== previewer.deferred.active.state() || previewer.loading ) { 4303 4304 synced.scroll = previewer.scroll; … … 4422 4423 */ 4423 4424 refresh: function() { 4424 var previewer = this ;4425 var previewer = this, onSettingChange; 4425 4426 4426 4427 // Display loading indicator … … 4435 4436 container: previewer.container 4436 4437 }); 4438 4439 previewer.settingsModifiedWhileLoading = {}; 4440 onSettingChange = function( setting ) { 4441 previewer.settingsModifiedWhileLoading[ setting.id ] = true; 4442 }; 4443 api.bind( 'change', onSettingChange ); 4444 previewer.loading.always( function() { 4445 api.unbind( 'change', onSettingChange ); 4446 } ); 4437 4447 4438 4448 previewer.loading.done( function( readyData ) { -
trunk/src/wp-includes/js/customize-preview.js
r39060 r39112 655 655 656 656 api.preview.bind( 'sync', function( events ) { 657 658 /* 659 * Delete any settings that already exist locally which haven't been 660 * modified in the controls while the preview was loading. This prevents 661 * situations where the JS value being synced from the pane may differ 662 * from the PHP-sanitized JS value in the preview which causes the 663 * non-sanitized JS value to clobber the PHP-sanitized value. This 664 * is particularly important for selective refresh partials that 665 * have a fallback refresh behavior since infinite refreshing would 666 * result. 667 */ 668 if ( events.settings && events['settings-modified-while-loading'] ) { 669 _.each( _.keys( events.settings ), function( syncedSettingId ) { 670 if ( api.has( syncedSettingId ) && ! events['settings-modified-while-loading'][ syncedSettingId ] ) { 671 delete events.settings[ syncedSettingId ]; 672 } 673 } ); 674 } 675 657 676 $.each( events, function( event, args ) { 658 677 api.preview.trigger( event, args );
Note: See TracChangeset
for help on using the changeset viewer.