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

Added support for requireFailure when multiple gestured are attached #57

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

blakgeek
Copy link

The existing requireFailure implementation doesn't always work because each gesture is a separate directive and not guaranteed to have been added to hammer instance. I added a new directive with higher priority to ensure that runs after all gestures have been added.

@blakgeek
Copy link
Author

Usage would be as follows.

<div hm-tap="foo" 
     hm-doubletap="bar"
     hm-require-failure"{tap: 'doubletap', 'doubletap': ['pan', 'zoom']}">
</div>

This would cancel tap on doubletap. Since the pan and zoom gestures aren't registered they are ignored and a warning is logged to the console. The quotes around the key event name is optional.

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.

1 participant