buberdds/angular-bootstrap-colorpicker — pull request #43 by 4kochi (2014-04-01 12:55:37+00:00)
Title: Unregister global mousedown event and optionally emit event that the color picker was hided

The unregister of the $document 'mousedown' event prevents that on every click in the document the event handler is triggered, even when the color picker is not visible.

The optional emit event is for cases when you do not want to watch the ng-model for changes. We have for example an array with a lot of items an each item contains a color picker. So the you would have to watch the whole array for changes of the color and that is a bit expensive.