Swatches for the color picker. Improves discoverability of colors especially when the picker is opened with a grayscale color. props mattwiebe. FIXES #21206.

git-svn-id: https://develop.svn.wordpress.org/trunk@22457 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-07 23:32:03 +00:00
parent 6b78173371
commit 0b66789582
2 changed files with 8 additions and 6 deletions

View File

@ -12,7 +12,8 @@
defaultColor: false, defaultColor: false,
change: false, change: false,
clear: false, clear: false,
hide: true hide: true,
palettes: true
}, },
_create: function() { _create: function() {
// bail early for IE < 8 // bail early for IE < 8
@ -43,6 +44,7 @@
hide: true, hide: true,
width: 255, width: 255,
mode: 'hsv', mode: 'hsv',
palettes: self.options.palettes,
change: function( event, ui ) { change: function( event, ui ) {
self.toggler.css( { backgroundColor: ui.color.toString() } ); self.toggler.css( { backgroundColor: ui.color.toString() } );
// check for a custom cb // check for a custom cb
@ -115,9 +117,9 @@
this.element.iris( "option", "color", newColor ); this.element.iris( "option", "color", newColor );
}, },
//$("#input").wpColorPicker('default_color') returns the current default color //$("#input").wpColorPicker('defaultColor') returns the current default color
//$("#input").wpColorPicker('default_color', newDefaultColor) to set //$("#input").wpColorPicker('defaultColor', newDefaultColor) to set
default_color: function( newDefaultColor ) { defaultColor: function( newDefaultColor ) {
if ( newDefaultColor === undef ) if ( newDefaultColor === undef )
return this.options.defaultColor; return this.options.defaultColor;

File diff suppressed because one or more lines are too long