Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Revert "No need to target find on the touchstart"
Browse files Browse the repository at this point in the history
This reverts commit bd19544.
  • Loading branch information
dfreedm committed Mar 31, 2014
1 parent bd19544 commit 86c341c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/touch.js
Expand Up @@ -7,6 +7,7 @@
(function(scope) {
var dispatcher = scope.dispatcher;
var captureInfo = dispatcher.captureInfo;
var findTarget = scope.findTarget;
var allShadows = scope.targetFinding.allShadows.bind(scope.targetFinding);
var pointermap = dispatcher.pointermap;
var touchMap = Array.prototype.map.call.bind(Array.prototype.map);
Expand Down Expand Up @@ -143,23 +144,18 @@
}
return ret;
},
findTarget: function(ev) {
if (this.currentTouchEvent.type === 'touchstart') {
return this.currentTouchEvent.target;
}
return scope.findTarget(ev);
},
touchToPointer: function(inTouch) {
var cte = this.currentTouchEvent;
var e = dispatcher.cloneEvent(inTouch);
// Spec specifies that pointerId 1 is reserved for Mouse.
// Touch identifiers can start at 0.
// Add 2 to the touch identifier for compatibility.
var id = e.pointerId = inTouch.identifier + 2;
e.target = captureInfo[id] || this.findTarget(e);
e.target = captureInfo[id] || findTarget(e);
e.bubbles = true;
e.cancelable = true;
e.detail = this.clickCount;
e.button = 0;
e.buttons = this.typeToButtons(cte.type);
e.width = inTouch.webkitRadiusX || inTouch.radiusX || 0;
e.height = inTouch.webkitRadiusY || inTouch.radiusY || 0;
Expand Down

0 comments on commit 86c341c

Please sign in to comment.