Skip to content
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

Open
thany opened this issue Oct 2, 2013 · 6 comments
Open

Should use jQuery eventing #1

thany opened this issue Oct 2, 2013 · 6 comments

Comments

@thany
Copy link

thany commented Oct 2, 2013

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 the trigger() function.

@shprink
Copy link
Contributor

shprink commented Dec 27, 2013

Can't we have both callbacks (synchronous) and events (asynchronous)?

@thany
Copy link
Author

thany commented Dec 30, 2013

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).

@josedvq
Copy link
Owner

josedvq commented Jan 22, 2014

Thanks for the suggestion. It's much easier that way. I'll work on this as soon as I have a chance.

@mrgrain
Copy link
Contributor

mrgrain commented Jan 17, 2015

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?

@thany
Copy link
Author

thany commented Jan 19, 2015

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.

@mrgrain
Copy link
Contributor

mrgrain commented Jan 19, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants