Theme Customizer: Ensure color pickers initialize to the correct color. see #19910.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
380985868b
commit
5338b8fd73
|
@ -172,7 +172,7 @@
|
||||||
parent = picker.parent(),
|
parent = picker.parent(),
|
||||||
toggle = parent.siblings('a'),
|
toggle = parent.siblings('a'),
|
||||||
value = api( parent.siblings('input').prop('name').replace( api.settings.prefix, '' ) ),
|
value = api( parent.siblings('input').prop('name').replace( api.settings.prefix, '' ) ),
|
||||||
farb;
|
farb, update;
|
||||||
|
|
||||||
value.validate = validateColor;
|
value.validate = validateColor;
|
||||||
text.link( value );
|
text.link( value );
|
||||||
|
@ -182,11 +182,14 @@
|
||||||
value.set( color.replace( '#', '' ) );
|
value.set( color.replace( '#', '' ) );
|
||||||
});
|
});
|
||||||
|
|
||||||
value.bind( function( color ) {
|
update = function( color ) {
|
||||||
color = '#' + color;
|
color = '#' + color;
|
||||||
toggle.css( 'background', color );
|
toggle.css( 'background', color );
|
||||||
farb.setColor( color );
|
farb.setColor( color );
|
||||||
});
|
};
|
||||||
|
|
||||||
|
value.bind( update );
|
||||||
|
update( value() );
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.color-picker a').click( function(e) {
|
$('.color-picker a').click( function(e) {
|
||||||
|
|
Loading…
Reference in New Issue