New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should use jQuery eventing #1
Comments
Can't we have both callbacks (synchronous) and events (asynchronous)? |
Sounds messy. I do think the callbacks need to be deprecated then, at least. Spew out a console warning maybe. I could be wrong btw, but I'm not sure that events are neccesarily asynchronous (nor are callbacks neccesarily synchrnous). They might just look that way. In either case, jQuery's eventing system has loads of advantages apart from uniformity (while uniformity may well be the greatest advantage - but ymmv). |
Thanks for the suggestion. It's much easier that way. I'll work on this as soon as I have a chance. |
As this plugin mimics Stefan Petre's color picker (http://www.eyecon.ro/colorpicker/), it would break code compatibly to remove or deprecate the callbacks. Maybe something for a more independent version 3? |
I'm not sure that compatibility with another plugin is valuable enough to keep archaic callbacks around. No offense, but I don't see the point. Besides, moving between any seemingly similar plugins is never trivial - as I've seen a fair share of datepickers, most of them work similarly, none of them are implemented similarly. |
Oh, I did this transition and TBH, I choose this plugin because of it's similarity. Both plugins have the same API, except from a new "base name" here ('colpick' instead of 'ColorPicker'). Plus, this one here is a real fork of Stefan Petre's. You'll notice when you diff both plugins. Don't get me wrong - I'm 100% with you to use the new and better eventing system. I'm only worried about the right versioning. |
Instead of passing callbacks via the options object, you should be using jQuery's event model. That's exactly what it's for. So your users can much more easily attach events using the
on()
function, making it work exactly the same as any other event. Calling such events is dead simple too, using thetrigger()
function.The text was updated successfully, but these errors were encountered: