IE 8(IE7) Bug with themeroller farbtastic

IE 8(IE7) Bug with themeroller farbtastic

Hey All, I was implementing a popup farbtastic color picker much like there is in themeroller.
 
I had a bug in my IE where clicking on the color wheel or in the center square would cause the thing to disappear(from my body.click or colorpicker.blur event).
 
I figured id see how themeroller does it, and notice you had the same problem.
 
Instead of (ala themeroller):

$(

'body' ).click( function (e) {

// //ie7 thinks were clicking on nothing when we click on the color picker...

$(

'div.picker-on' ).removeClass( 'picker-on' );

$(

'#picker' ).remove();

$(

'input.focus, select.focus' ).removeClass( 'focus' );

 

});
 
you do the following:
 

$(

'body').click(function (e) {

//if the clicked target belongs to the picker, dont close.

var target = $(e.target);

var numPickerParents = target.parents(".picker-on").length;

if (numPickerParents < 1) {

// //ie7 thinks were clicking on nothing when we click on the color picker...

$(

'div.picker-on').removeClass('picker-on');

$(

'#picker').remove();

$(

'input.focus, select.focus').removeClass('focus');

}

});
 
You can click around just fine in IE7/8.
 
Thanks for the awesome site and working example of how to do it right :)