diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index f28df6e..d207e79 100644
|
|
|
5629 | 5629 | |
5630 | 5630 | // @todo These should actually toggle the active state, but without the preview overriding the state in data.activeControls. |
5631 | 5631 | toggleVisibility = function( preset ) { |
5632 | | api.control( 'background_position' ).container.toggle( visibility[ preset ][0] ); |
5633 | | api.control( 'background_size' ).container.toggle( visibility[ preset ][1] ); |
5634 | | api.control( 'background_repeat' ).container.toggle( visibility[ preset ][2] ); |
5635 | | api.control( 'background_attachment' ).container.toggle( visibility[ preset ][3] ); |
| 5632 | _.each( [ 'background_position', 'background_size', 'background_repeat', 'background_attachment' ], function( controlId, i ) { |
| 5633 | var control = api.control( controlId ); |
| 5634 | if ( control ) { |
| 5635 | control.container.toggle( visibility[ preset ][ i ] ); |
| 5636 | } |
| 5637 | } ); |
5636 | 5638 | }; |
5637 | 5639 | |
5638 | 5640 | updateSettings = function( preset ) { |
5639 | | api( 'background_position_x' ).set( values[ preset ][0] ); |
5640 | | api( 'background_position_y' ).set( values[ preset ][1] ); |
5641 | | api( 'background_size' ).set( values[ preset ][2] ); |
5642 | | api( 'background_repeat' ).set( values[ preset ][3] ); |
5643 | | api( 'background_attachment' ).set( values[ preset ][4] ); |
| 5641 | _.each( [ 'background_position_x', 'background_position_y', 'background_size', 'background_repeat', 'background_attachment' ], function( settingId, i ) { |
| 5642 | var setting = api( settingId ); |
| 5643 | if ( setting ) { |
| 5644 | setting.set( values[ preset ][ i ] ); |
| 5645 | } |
| 5646 | } ); |
5644 | 5647 | }; |
5645 | 5648 | |
5646 | 5649 | preset = control.setting.get(); |