Skip to content

Commit

Permalink
Merge pull request madrobby#1182 from paper/master
Browse files Browse the repository at this point in the history
  • Loading branch information
madrobby authored Jul 11, 2016
2 parents 576da68 + 487cdf2 commit e040336
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@
(touch.y2 && Math.abs(touch.y1 - touch.y2) > 30))

swipeTimeout = setTimeout(function() {
touch.el.trigger('swipe')
touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
if (touch.el){
touch.el.trigger('swipe')
touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
}
touch = {}
}, 0)

Expand All @@ -125,7 +127,8 @@
// (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
var event = $.Event('tap')
event.cancelTouch = cancelAll
touch.el.trigger(event)
// [by paper] fix -> "TypeError: 'undefined' is not an object (evaluating 'touch.el.trigger'), when double tap
if (touch.el) touch.el.trigger(event)

// trigger double tap immediately
if (touch.isDoubleTap) {
Expand Down

0 comments on commit e040336

Please sign in to comment.