vanderlee/colorpicker — pull request #13 by boutell (2012-01-12 22:52:22+00:00)
Title: Fix default cursor position in colormap, allow changing color from outside the widget, don't lose current color when reopening, ease of calling _change() whether open or not

Note: all issues were initially confirmed in Chrome.

* On opening the widget the cursor is always stuck in the upper left corner of the colormap, not because it doesn't know the color to initialize to, but because the width of the div isn't available yet. Fixed this with a repaint of all components on domready at the end of the widget's open: method

* The widget has no way to change the current color from outside the widget. Added a setColor: method which is invoked by the Restore Defaults functionality

* When updating the current color in the _change method the colorpicker set the value of the underlying input field but did not update its own color option, so the next open() of the same widget would ignore its most recent value in favor of its original value when the widget was created. Fixed this by setting this.options.color to the same hex color as the input element

* Fixed the _change() method so it's safe to call whether the widget is open or not. This is very useful in setColor()