Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
madrobby committed Apr 5, 2012
1 parent d4bd9e6 commit a96836d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
}

var longTapDelay = 750, longTapTimeout

function longTap(){
longTapTimeout = null
if (touch.last && (Date.now() - touch.last >= longTapDelay)) {
if (touch.last) {
touch.el.trigger('longTap')
touch = {}
}
Expand All @@ -40,6 +40,8 @@
touch.x2 = e.touches[0].pageX
touch.y2 = e.touches[0].pageY
}).bind('touchend', function(e){
if (longTapTimeout) clearTimeout(longTapTimeout)
longTapTimeout = null
if (touch.isDoubleTap) {
touch.el.trigger('doubleTap')
touch = {}
Expand Down

0 comments on commit a96836d

Please sign in to comment.