angular-hammer icon indicating copy to clipboard operation
angular-hammer copied to clipboard

Added support for requireFailure when multiple gestured are attached

Open blakgeek opened this issue 10 years ago • 1 comments

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 avatar Jul 16 '15 16:07 blakgeek

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.

blakgeek avatar Jul 16 '15 17:07 blakgeek