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

Allow binding custom events to non-form elements #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxpoulin64
Copy link

Some UI libraries (like jQuery UI) relies on DOM events to dispatch updates events. An example would be the jQuery UI sliders, which triggers a "slide" event on its containing

element when the slider changes position and should update the value.

Epoxy previously refused to bind events to non form elements like divs so it was impossible to create bindingHandlers using those events. set() was working correctly but get() was never ever called because the events were never bound due to changable being false. I fixed it so when a user manually passes events, they are bound regardless of if it's a form element or not. Passing events on the DOM for custom widgets is not uncommon so I thought I should share the modification =]

(Note: this is my first pull request ever, please excuse my mistakes if any!)

Epoxy previously refused to bind events to non form elements like <div>s so it was impossible to create bindingHandlers for some UI libraries like jQuery UI's "slide" event. This now allows it to still avoid binding useless events while still allowing custom events to be forced in by the user.
@gmac
Copy link
Owner

gmac commented Mar 4, 2014

Cool, thanks. Out of the country at the moment, I'll try to review in the coming weeks and give the pass/fail/cleanup.

@OneGeek
Copy link

OneGeek commented Jul 16, 2014

I ran into this issue yesterday, ended up modifying my local copy of epoxy.js, but would like to see this fix merged and deployed to bower if possible.

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

Successfully merging this pull request may close these issues.

3 participants