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

File diff suppressed because one or more lines are too long