Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Use source target for touch-action calculation
Browse files Browse the repository at this point in the history
currentTarget may be too high up the tree
  • Loading branch information
dfreedm committed Aug 1, 2014
1 parent 49fe2d0 commit 6812fbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/targetfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@
return this.searchRoot(s, x, y);
},
findTouchAction: function(inEvent) {
var n, ct = inEvent.currentTarget;
var n;
if (HAS_FULL_PATH && inEvent.path) {
var path = inEvent.path;
for (var i = path.indexOf(ct); i >= 0 && i < path.length; i++) {
for (var i = 0; i < path.length; i++) {
n = path[i];
if (n.hasAttribute('touch-action')) {
if (n.nodeType === Node.ELEMENT_NODE && n.hasAttribute('touch-action')) {
return n.getAttribute('touch-action');
}
}
} else {
n = inEvent.currentTarget;
n = inEvent.target;
while(n) {
if (n.hasAttribute('touch-action')) {
return n.getAttribute('touch-action');
Expand Down

0 comments on commit 6812fbb

Please sign in to comment.