-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Remove onclick attributes #529
Conversation
This changes makes it more difficult for new programmers to understand where the onclick event ends up. I also guess that this change will cause problems in different IE versions... |
I will test this tomorrow. |
Removing the "onclick" attribute sounds like a good idea. This is indeed a common practice to "bind" events to a DOM on the JS side to avoid code mixing. Then an array could hold a correspondence between the buttons ids and the corresponding action or even "guess" the corresponding action using a naming convention. example:
But there is something I still do not understand. Why are you replacing the links by buttons ? Buttons are much harder to work with in cross-browsers applications... |
Good work @cweider. A few Q's and pointers.
|
@jtlebi, yea, moving the bar’s construction further into JavaScript would be a good idea (see #470). Regarding @johnyma22, I doubt it has any effect on loading time (the |
The soonest I can test and pull this is Thursday. Two reasons a) I'm really busy at the mo |
testing this today |
The padding beneath the buttons is slightly too small in firefox |
Can you please give this a quick polish then open a pull request so it goes into the develop branch? Should be good to pretty much merge once it's been polished slightly. IE seems fine |
Update? :) A few remarks:
|
This pull is invalid, at least because it’s headed into master. A version of this without converting to button tags would be better, though still may or may not makes until plugin stuff is all finished. |
Shifts event handling into from
onclick
attributes intopad_editbar
. Also has an irrelevant, but maybe nice, change from anchors to buttons in the editbar markup (IE7 looks a little funny… thoughts?). Addresses concerns from #504.