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:
Daryl Koopersmith 2012-03-06 02:14:27 +00:00
parent c7769fabfd
commit e841432c7c
1 changed files with 6 additions and 3 deletions

View File

@ -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) {