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

Commit

Permalink
Add the element under the pointer to track events as relatedTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Oct 31, 2013
1 parent 6bfae8a commit 5374726
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
* @type Object
* @property trackInfo
*/
/**
* The element currently under the pointer.
* @type Element
* @property relatedTarget
*/
/**
* The type of pointer that make the track gesture.
* @type String
Expand All @@ -97,7 +102,7 @@

(function(scope) {
var dispatcher = scope.dispatcher;
var pointermap = new scope.PointerMap;
var pointermap = new scope.PointerMap();
var track = {
events: [
'pointerdown',
Expand Down Expand Up @@ -141,13 +146,9 @@
xDirection: t.xDirection,
yDirection: t.yDirection,
trackInfo: t.trackInfo,
relatedTarget: inEvent.target,
pointerType: inEvent.pointerType
};
if (inType === 'trackend') {
// TODO(dfreedman): this will leak shadowdom targets, replace with a
// more sophisticated mechanism
trackData._releaseTarget = inEvent.target;
}
var e = dispatcher.makeEvent(inType, trackData);
t.lastMoveEvent = inEvent;
dispatcher.dispatchEvent(e, t.downTarget);
Expand Down

0 comments on commit 5374726

Please sign in to comment.