Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Only send dirty settings to be saved into the snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jun 12, 2016
1 parent 31602e0 commit deb0ddd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions js/customize-snapshots.js
Expand Up @@ -136,10 +136,11 @@

if ( component.data.isPreview ) {
api.each( function( value, key ) {
allCustomized[ key ] = {
'value': value(),
'dirty': value._dirty
};
if ( value._dirty ) {
allCustomized[ key ] = {
'value': value()
};
}
} );
retval.snapshot_customized = JSON.stringify( allCustomized );
retval.snapshot_uuid = component.data.uuid;
Expand Down Expand Up @@ -248,10 +249,11 @@

customized = {};
api.each( function( value, key ) {
customized[ key ] = {
'value': value(),
'dirty': value._dirty
};
if ( value._dirty ) {
customized[ key ] = {
'value': value()
};
}
} );

request = wp.ajax.post( 'customize_update_snapshot', {
Expand Down

0 comments on commit deb0ddd

Please sign in to comment.