diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 56c061f..b43c1df 100644
|
|
|
4299 | 4299 | var previewer = this, synced = {}, constructs; |
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; |
4304 | 4305 | } |
… |
… |
|
4421 | 4422 | * Refresh the preview seamlessly. |
4422 | 4423 | */ |
4423 | 4424 | refresh: function() { |
4424 | | var previewer = this; |
| 4425 | var previewer = this, onSettingChange; |
4425 | 4426 | |
4426 | 4427 | // Display loading indicator |
4427 | 4428 | previewer.send( 'loading-initiated' ); |
… |
… |
|
4435 | 4436 | container: previewer.container |
4436 | 4437 | }); |
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 | } ); |
| 4447 | |
4438 | 4448 | previewer.loading.done( function( readyData ) { |
4439 | 4449 | var loadingFrame = this, previousPreview, onceSynced; |
4440 | 4450 | |
diff --git src/wp-includes/js/customize-preview.js src/wp-includes/js/customize-preview.js
index 484ccf4..009ec3a 100644
|
|
|
654 | 654 | }); |
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 pane 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 ); |
659 | 678 | }); |