Theme Customizer: Ensure color pickers initialize to the correct color. see #19910.
git-svn-id: https://develop.svn.wordpress.org/trunk@20121 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c7769fabfd
commit
e841432c7c
@ -172,7 +172,7 @@
|
||||
parent = picker.parent(),
|
||||
toggle = parent.siblings('a'),
|
||||
value = api( parent.siblings('input').prop('name').replace( api.settings.prefix, '' ) ),
|
||||
farb;
|
||||
farb, update;
|
||||
|
||||
value.validate = validateColor;
|
||||
text.link( value );
|
||||
@ -182,11 +182,14 @@
|
||||
value.set( color.replace( '#', '' ) );
|
||||
});
|
||||
|
||||
value.bind( function( color ) {
|
||||
update = function( color ) {
|
||||
color = '#' + color;
|
||||
toggle.css( 'background', color );
|
||||
farb.setColor( color );
|
||||
});
|
||||
};
|
||||
|
||||
value.bind( update );
|
||||
update( value() );
|
||||
});
|
||||
|
||||
$('.color-picker a').click( function(e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user