ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
165 stars 78 forks source link

Allow onOpen and onClose events #83

Closed zaalbarxx closed 8 years ago

zaalbarxx commented 8 years ago

Hi! I think it would be a good idea to allow user handling event like open and close, for example I'd like to show bar with recently selected colors at the bottom of picker, but currently I have no possibility to check if the picker is opened or closed. We could create two new attributes on directive or allow user to provide a model which would change when picker is opened or closed. What do you think about this ? I think it is rather easy to implement as it's just a matter of adding a couple lines of code.

zaalbarxx commented 8 years ago

I created a pull request, let me know if you are satisfied with it. Thanks ! https://github.com/ruhley/angular-color-picker/pull/84

EDIT: Actually I think it would be a good option too if we could control visibility of the picker programatically, so we could add one variable with 2-way binding that would serve as off/on. What do you think ?

ruhley commented 8 years ago

I think exposing an api would be better. I will put it together as soon as possible.

ruhley commented 8 years ago

I have created v2.0.0 with some large changes including exposing an api.