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

Drop "on" prefix from event names #17

Open
davetodd opened this issue May 9, 2014 · 4 comments
Open

Drop "on" prefix from event names #17

davetodd opened this issue May 9, 2014 · 4 comments

Comments

@davetodd
Copy link
Contributor

davetodd commented May 9, 2014

Right now all the events have the "on" prefix, like "onvaluechange" and "onfocus". This is weird because you have to do editor.on("onvaluechange"). I believe this was done to avoid conflicts with the jQuery focus event, but we should still figure out a way to work around it.

@chriskwan
Copy link
Contributor

@leobalter, @Wilto we were thinking an easy way to fix this would be to namespace the events, e.g. "arte:focus" instead of "onfocus". What do you guys think of this approach or is there a better way?

@leobalter
Copy link
Contributor

Custom events are a good idea, but they might not be exactly the necessary fix to avoid conflicts. I'll take at ArteJS events interface to give you a better feedback.

@Wilto
Copy link
Contributor

Wilto commented Feb 24, 2015

I think namespacing might be a good first step here, but I’ll defer to @leobalter.

@ilyavolodin
Copy link
Contributor

Just to give a bit of history, the reasons why events are prefixed with "on" is because when this project was started, there was no plans originally to make jQuery wrapper for it. Because of that, to confirm better to browser events like document.getElementById("#a").onclick = ... events were prefixed with "on". I guess it was never changed later.

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

No branches or pull requests

5 participants