RyanMullins / angular-hammer

Hammer.js v2 support for AngularJS
http://ryanmullins.github.io/angular-hammer/
MIT License
188 stars 55 forks source link

vertical pan #3

Closed porjo closed 9 years ago

porjo commented 9 years ago

I'm having trouble making angular-hammer detect a vertical pan only. Only after panning horizontally is a vertical pan detected.

As mentioned in the Getting Started section of Hammerjs, by default, pan does not respond to vertical events initially. To override this DIRECTION_ALL has to be set - not as an option parameter on the object instantiation, but on a separate call to set(). An example can be seen here: http://codepen.io/jtangelder/pen/ABFnd

How would I achieve this with angular-hammer?

I've tried using hm-custom like so:

[{"type":"pan", "event":"vertPan", "pointers":0, "direction":"DIRECTION_ALL", "val":"onHammer"}]

But that's not working. See: http://jsfiddle.net/40a1693m/2/

porjo commented 9 years ago

@lookfirst PR #4 works for me, thanks! @RyanMullins please merge

RyanMullins commented 9 years ago

Done. Thanks for contributing.