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

Doesn't work when using the jquery.hammer plugin #4

Open
stebun opened this issue Jul 3, 2015 · 4 comments
Open

Doesn't work when using the jquery.hammer plugin #4

stebun opened this issue Jul 3, 2015 · 4 comments

Comments

@stebun
Copy link

stebun commented Jul 3, 2015

How can I get this to work with the jquery plugin for hammer 2.0?

If I use the hammer plugin propagation doesn't work. If I don't use the hammer plugin hammer propagation does work with your propagation.js script

@stebun
Copy link
Author

stebun commented Jul 3, 2015

I have two elements, parent and child working with tap.

currently Im testing the event object in my parent for event.isTrigger === undefined.

If this property isn't there I know this event is caused directly by the parent tap, if it is there, it means that the child tap event was called and I can ignore this tap on the parent.

I also need to set domEvents: true on the call to the hammer plugin "hammer({domEvents: true})" for the parent (not the child);

I'm not sure how reliable this is cross browser or how it would work with a child within a child, but for my current needs it works.

Still it would be nice if I could use the jquery plugin and use the propagation.js

@josdejong
Copy link
Owner

It may work if you first load the propagating-hammer.js script, then override the global Hammer instance (like in this example), and last load jquery.hammer.js. Did you try that?

@stebun
Copy link
Author

stebun commented Jul 6, 2015

Yes this worked, but it's annoying to have to load the plugin afterwards. Can't you do anything to fix this? There must be lots of people using the widget and your propagation.js

@josdejong
Copy link
Owner

I can think of two options:

  • Create a new module jquery.propagating.hammer.js which combines both.
  • Use vanilla JavaScript instead of jquery.hammer.js. There isn't really much need for jQuery anymore, and JavaScript isn't that scary ;)

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

2 participants