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: http://core.svn.wordpress.org/trunk@22457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-07 23:32:03 +00:00
parent 9cc507b1c9
commit 23a7a49f59
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