-
Notifications
You must be signed in to change notification settings - Fork 740
import events from html5 menus #205
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
import events from html5 menus #205
Conversation
just realized that my text editor removed all trailing spaces. Should I reintroduce them back? @rodneyrehm dom event types are listed in array. String was way too long. Multiline string generated new empty string array elements for each identation. And having string concatenation looked even worse. |
list of DOM event types taken from here: http://www.w3.org/html/wg/drafts/html/master/webappapis.html#event-handlers-on-elements,-document-objects,-and-window-objects |
Nice! I think I wouldn't go with a static list of events, but rather do something along the lines of var eventNames = Object.keys(node)
.filter(function(propertyName){ return propertyName.slice(0, 2) === 'on'; })
.map(function(propertyName){ return propertyName.slice(2) }); (yes, I'd roll the filtering, mapping and event-registration into one loop, this is for illustration only. Same goes for |
@rodneyrehm Cool! I like your suggestion! Just a sec |
@rodneyrehm according to W3C spec all html elements must support these event types. I think it would make more sense to do something like this:
and reuse that array within |
@rodneyrehm event types differ a lot between browsers: chrome, firefox, ie9. Shall we keep it the same way or use a list events from W3C? |
I'd only bind the events a browser understands… so I'd stick with detection rather than static list. |
OK. Let me know if you think anything else should be changed |
@rodneyrehm What needs to be done for this PR to be accepted? |
time to merge and test the stuff |
OK |
My time is extremely short. If you're interested in taking over the lead of this plugin for a while, we can talk about giving you the necessary privileges - contact me at mail at rodneyrehm dot de if you're interested |
takes everything what @jbinary has done in #137 and adds improvements mentioned by @rodneyrehm