diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 0abfb77..4901b56 100644
|
|
|
|
| 3345 | 3345 | value._dirty = false; |
| 3346 | 3346 | } ); |
| 3347 | 3347 | |
| | 3348 | api.previewer.send( 'saved', response ); |
| | 3349 | |
| 3348 | 3350 | api.trigger( 'saved', response ); |
| 3349 | 3351 | } ); |
| 3350 | 3352 | }; |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index f5aa604..aa73ed7 100644
|
|
|
final class WP_Customize_Manager { |
| 805 | 805 | 'activePanels' => array(), |
| 806 | 806 | 'activeSections' => array(), |
| 807 | 807 | 'activeControls' => array(), |
| | 808 | '_dirty' => array_keys( $this->unsanitized_post_values() ), |
| 808 | 809 | ); |
| 809 | 810 | |
| 810 | 811 | if ( 2 == $this->nonce_tick ) { |
diff --git src/wp-includes/js/customize-preview.js src/wp-includes/js/customize-preview.js
index 4bf625e..bee0b62 100644
|
|
|
|
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | 86 | $( function() { |
| | 87 | var bg, setValue; |
| | 88 | |
| 87 | 89 | api.settings = window._wpCustomizeSettings; |
| 88 | | if ( ! api.settings ) |
| | 90 | if ( ! api.settings ) { |
| 89 | 91 | return; |
| 90 | | |
| 91 | | var bg; |
| | 92 | } |
| 92 | 93 | |
| 93 | 94 | api.preview = new api.Preview({ |
| 94 | 95 | url: window.location.href, |
| 95 | 96 | channel: api.settings.channel |
| 96 | 97 | }); |
| 97 | 98 | |
| | 99 | /** |
| | 100 | * Create/update a setting value. |
| | 101 | * |
| | 102 | * @param {string} id - Setting ID. |
| | 103 | * @param {*} value - Setting value. |
| | 104 | */ |
| | 105 | setValue = function( id, value ) { |
| | 106 | var setting = api( id ); |
| | 107 | if ( setting ) { |
| | 108 | setting.set( value ); |
| | 109 | } else { |
| | 110 | api.create( id, value, { |
| | 111 | id: id |
| | 112 | } ); |
| | 113 | } |
| | 114 | }; |
| | 115 | |
| 98 | 116 | api.preview.bind( 'settings', function( values ) { |
| 99 | | $.each( values, function( id, value ) { |
| 100 | | if ( api.has( id ) ) |
| 101 | | api( id ).set( value ); |
| 102 | | else |
| 103 | | api.create( id, value ); |
| 104 | | }); |
| | 117 | $.each( values, setValue ); |
| 105 | 118 | }); |
| 106 | 119 | |
| 107 | 120 | api.preview.trigger( 'settings', api.settings.values ); |
| 108 | 121 | |
| 109 | | api.preview.bind( 'setting', function( args ) { |
| 110 | | var value; |
| 111 | | |
| 112 | | args = args.slice(); |
| | 122 | $.each( api.settings._dirty, function( i, id ) { |
| | 123 | var setting = api( id ); |
| | 124 | if ( setting ) { |
| | 125 | setting._dirty = true; |
| | 126 | } |
| | 127 | } ); |
| 113 | 128 | |
| 114 | | if ( value = api( args.shift() ) ) |
| 115 | | value.set.apply( value, args ); |
| | 129 | api.preview.bind( 'setting', function( args ) { |
| | 130 | setValue.apply( null, args.slice() ); |
| 116 | 131 | }); |
| 117 | 132 | |
| 118 | 133 | api.preview.bind( 'sync', function( events ) { |
| … |
… |
|
| 130 | 145 | api.preview.send( 'documentTitle', document.title ); |
| 131 | 146 | }); |
| 132 | 147 | |
| | 148 | api.preview.bind( 'saved', function( response ) { |
| | 149 | api.trigger( 'saved', response ); |
| | 150 | } ); |
| | 151 | |
| | 152 | api.bind( 'saved', function() { |
| | 153 | api.each( function( setting ) { |
| | 154 | setting._dirty = false; |
| | 155 | } ); |
| | 156 | } ); |
| | 157 | |
| 133 | 158 | /* |
| 134 | 159 | * Send a message to the parent customize frame with a list of which |
| 135 | 160 | * containers and controls are active. |