@ -105,7 +105,7 @@
if ( event === true ) { // resize, scroll
return ;
}
_$alpha . _width = _$alpha . width ( ) ;
_$alpha . toggle( ! ! _options . opacity ) . _width = _$alpha . width ( ) ;
_$xy _slider . _width = _$xy _slider . width ( ) ;
_$xy _slider . _height = _$xy _slider . height ( ) ;
_$z _slider . _height = _$z _slider . height ( ) ;
@ -138,7 +138,7 @@
_$xy _slider = $ ( '.cp-xy-slider' , this ) ;
_$xy _cursor = $ ( '.cp-xy-cursor' , this ) ;
_$z _cursor = $ ( '.cp-z-cursor' , this ) ;
_$alpha = $ ( '.cp-alpha' , this ) .toggle ( ! ! _options . opacity ) ;
_$alpha = $ ( '.cp-alpha' , this ) ;
_$alpha _cursor = $ ( '.cp-alpha-cursor' , this ) ;
_options . buildCallback . call ( _colorPicker , $this ) ;
$this . prepend ( '<div>' ) . children ( ) . eq ( 0 ) . css ( 'width' ,
@ -268,7 +268,8 @@
}
$ . fn . colorPicker = function ( options ) {
var noop = function ( ) { } ;
var _this = this ,
noop = function ( ) { } ;
options = $ . extend ( {
animationSpeed : 150 ,
@ -295,18 +296,22 @@
}
} ) ;
_instance = _instance . add ( this ) ;
this . colorPicker = _ instance. colorPicker =
_colorPicker || new ColorPicker ( options ) ;
this . colorPicker = _ colorPicker || new ColorPicker ( options ) ;
this . options = options ;
$ ( options . body ) . off ( '.tcp' ) . on ( _pointerdown , function ( e ) {
! _instance . add ( _$UI ) . find ( e . target )
. add ( _instance . filter ( e . target ) ) [ 0 ] && toggle ( ) ;
} ) ;
return this . on ( 'focusin.tcp click.tcp' , toggle )
return this . on ( 'focusin.tcp click.tcp' , function ( event ) {
_colorPicker . color . options = // swap options to fake new instance
$ . extend ( _colorPicker . color . options , _options = _this . options ) ;
toggle . call ( this , event ) ;
} )
. on ( 'change.tcp' , function ( ) {
_color . setColor ( this . value || '#FFF' ) ;
_instance . colorPicker . render ( true ) ;
_ th is. colorPicker . render ( true ) ;
} )
. each ( function ( ) {
var value = extractValue ( this ) ,