diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index fad223e..b1f2ebc 100644
|
|
|
170 | 170 | control.setting.set( false ); |
171 | 171 | } |
172 | 172 | }); |
| 173 | |
| 174 | this.setting.bind( function ( value ) { |
| 175 | picker.val( value ); |
| 176 | picker.wpColorPicker( 'color', value ); |
| 177 | }); |
173 | 178 | } |
174 | 179 | }); |
175 | 180 | |
diff --git src/wp-content/themes/twentyfifteen/js/color-scheme-control.js src/wp-content/themes/twentyfifteen/js/color-scheme-control.js
index 4462f98..46f4a47 100644
|
|
|
5 | 5 | * Adds listener to Color Scheme control to update other color controls with new values/defaults |
6 | 6 | */ |
7 | 7 | |
8 | | ( function( wp ) { |
9 | | wp.customize.controlConstructor.colorScheme = wp.customize.Control.extend( { |
| 8 | ( function( customize ) { |
| 9 | customize.controlConstructor.colorScheme = customize.Control.extend( { |
10 | 10 | ready: function() { |
11 | | var parentSection = this.container.closest( '.control-section' ), |
12 | | headerTextColor = parentSection.find( '#customize-control-header_textcolor .color-picker-hex' ), |
13 | | backgroundColor = parentSection.find( '#customize-control-background_color .color-picker-hex' ), |
14 | | sidebarColor = parentSection.find( '#customize-control-header_background_color .color-picker-hex' ), |
15 | | sidebarTextColor = parentSection.find( '#customize-control-sidebar_textcolor .color-picker-hex' ); |
16 | 11 | |
17 | 12 | this.setting.bind( 'change', function( value ) { |
18 | 13 | // if Header Text is not hidden, update value |
19 | | if ( 'blank' !== wp.customize( 'header_textcolor' ).get() ) { |
20 | | wp.customize( 'header_textcolor' ).set( colorScheme[value].colors[4] ); |
21 | | headerTextColor.val( colorScheme[value].colors[4] ) |
| 14 | if ( 'blank' !== customize( 'header_textcolor' ).get() ) { |
| 15 | customize( 'header_textcolor' ).set( colorScheme[value].colors[4] ); |
| 16 | customize.control( 'header_textcolor' ).container.find( '.color-picker-hex' ) |
22 | 17 | .data( 'data-default-color', colorScheme[value].colors[4] ) |
23 | | .wpColorPicker( 'color', colorScheme[value].colors[4] ) |
24 | 18 | .wpColorPicker( 'defaultColor', colorScheme[value].colors[4] ); |
25 | 19 | } |
26 | 20 | |
27 | 21 | // update Background Color |
28 | | wp.customize( 'background_color' ).set( colorScheme[value].colors[0] ); |
29 | | backgroundColor.val( colorScheme[value].colors[0] ) |
| 22 | customize( 'background_color' ).set( colorScheme[value].colors[0] ); |
| 23 | customize.control( 'background_color' ).container.find( '.color-picker-hex' ) |
30 | 24 | .data( 'data-default-color', colorScheme[value].colors[0] ) |
31 | | .wpColorPicker( 'color', colorScheme[value].colors[0] ) |
32 | 25 | .wpColorPicker( 'defaultColor', colorScheme[value].colors[0] ); |
33 | 26 | |
34 | 27 | // update Header/Sidebar Background Color |
35 | | wp.customize( 'header_background_color' ).set( colorScheme[value].colors[1] ); |
36 | | sidebarColor.val( colorScheme[value].colors[1] ) |
| 28 | customize( 'header_background_color' ).set( colorScheme[value].colors[1] ); |
| 29 | customize.control( 'header_background_color' ).container.find( '.color-picker-hex' ) |
37 | 30 | .data( 'data-default-color', colorScheme[value].colors[1] ) |
38 | | .wpColorPicker( 'color', colorScheme[value].colors[1] ) |
39 | 31 | .wpColorPicker( 'defaultColor', colorScheme[value].colors[1] ); |
40 | 32 | |
41 | 33 | // update Sidebar Text Color |
42 | | wp.customize( 'sidebar_textcolor' ).set( colorScheme[value].colors[4] ); |
43 | | sidebarTextColor.val( colorScheme[value].colors[4] ) |
| 34 | customize( 'sidebar_textcolor' ).set( colorScheme[value].colors[4] ); |
| 35 | customize.control( 'sidebar_textcolor' ).container.find( '.color-picker-hex' ) |
44 | 36 | .data( 'data-default-color', colorScheme[value].colors[4] ) |
45 | | .wpColorPicker( 'color', colorScheme[value].colors[4] ) |
46 | 37 | .wpColorPicker( 'defaultColor', colorScheme[value].colors[4] ); |
47 | 38 | } ); |
48 | 39 | } |
49 | 40 | } ); |
50 | | } )( this.wp ); |
51 | | No newline at end of file |
| 41 | } )( this.wp.customize ); |