REQUEST: colorpicker("close"), colorpicker("open")
I had to create workaround or hack for the "Done" button in the
colorpicker dialog to close itself. I had to look at the source code
"ui.colorpicker.js" to find the close event:
$(document).trigger('mousedown.colorpicker');
I know the purpose of the "Done" button, but it only make sense when
it's set to flat. I find unintuitive as a popup and so I want it to
close either by clicking the "Done" button or outside.
$('.picker_icon', eleForm).colorpicker({
submit:function(e, ui) {
this.previousSibling.value = ui.hex;
// Set background/foreground color.
$(this.previousSibling).css({
backgroundColor:'#' + ui.hex,
color:ui.hsb.b > 70 ? '#000' : '#fff'
});
$(document).trigger('mousedown.colorpicker');
},
beforeShow:function(e, ui) {
$(this).colorpicker('setColor', this.previousSibling.value);
}
});
Sincerely,
Will