wzr1337 / angular-gestures

AngularJS directive that adds support for multi touch gestures to your app. Based on hammer.js.
MIT License
510 stars 100 forks source link

Double Tap #31

Open tomhoogenboom opened 9 years ago

tomhoogenboom commented 9 years ago

Thanks for the lib!

I was just playing around a little bit with all the events but I can't seem to get the 'double tap' working? Can somebody tell me what I'm doing wrong?

There's a preview on http://preview.tomhoogenboom.nl

In my view I have:

<div hm-double-tap="test($event)"></div>

In my app.config I'm having the following:

hammerDefaultOptsProvider.set({
        recognizers: [
          [Hammer.Tap, { time: 250 }],
          [Hammer.Swipe]
        ]
    });

If I add a [Hammer.DoubleTap] here I'm getting an error " TypeError: undefined is not a function" from hammer.js when it tries to loop through the recognizers.

Am I doing something wrong and can somebody please help me?

wzr1337 commented 9 years ago

I am also experiencing issues with double tap, trying to find out what the actual issue is

jpeterson88 commented 9 years ago

@tomhoogenboom it seems double tap is a tap with an interval between taps. If you look at the recognizers it shows it as Hammer.Tap, so it looks something like this:

     recognizers: [
         [Hammer.Tap, { enable: true }],
         [Hammer.Tap, { enable: true }, { event: 'doubletap', taps: 2 }, { interval: 600 }],
         [Hammer.Press, { enable: true }]
     ]

However, I am actually still getting errors with the double tap even with this code. My code is actually blowing out in hammer.js when it's trying to set "otherRecognizer".

aszharite commented 9 years ago

Is this fixed? I am still getting 2 taps instead of a double-tap. My angularJS version is 1.3.15.

roblav96 commented 9 years ago

still have this problem here also :/

johannesjo commented 8 years ago

I'm also experiencing this unfortunately.

botjaeger commented 8 years ago

guys? is it fixed?

vukasin-bozovic commented 8 years ago

I have the same problem. :/

anztenney commented 7 years ago

This worked for me:

recognizers: [
      [Hammer.Tap, {enabled:true}], 
      [Hammer.Tap, { event: 'doubletap', taps: 2 }, 'tap'], 
      [Hammer.Press, {enabled:true}]
]