Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug where target returns null when touching outside the viewport.
  • Loading branch information
cheeaun committed Oct 17, 2011
1 parent 08e844d commit 4d5b0bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/tappable.js
Expand Up @@ -51,7 +51,7 @@ var tappable = function(el, opts){
clientY = changedTouches.clientY, clientY = changedTouches.clientY,
target = document.elementFromPoint(clientX, clientY); target = document.elementFromPoint(clientX, clientY);
if (!e.target) e.target = target; if (!e.target) e.target = target;
if (target.nodeType == 3) target = target.parentNode; if (target && target.nodeType == 3) target = target.parentNode;


if (noScroll){ if (noScroll){
if (target != el){ if (target != el){
Expand All @@ -78,7 +78,7 @@ var tappable = function(el, opts){


var target = document.elementFromPoint(e.changedTouches[0].clientX, e.changedTouches[0].clientY); var target = document.elementFromPoint(e.changedTouches[0].clientX, e.changedTouches[0].clientY);
if (!e.target) e.target = target; if (!e.target) e.target = target;
if (target.nodeType == 3) target = target.parentNode; if (target && target.nodeType == 3) target = target.parentNode;


options.onEnd.call(el, e, target); options.onEnd.call(el, e, target);


Expand Down

0 comments on commit 4d5b0bb

Please sign in to comment.