-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from nickschot/pointer-events
implement PointerEvents replacing TouchEvents
- Loading branch information
Showing
12 changed files
with
128 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Generates a PointerEvent for testing purposes | ||
* | ||
* @param {Element} target | ||
* @param {string} eventType pointerdown, pointermove or pointerend | ||
* @param {number} x | ||
* @param {number} y | ||
* @param {number} identifier | ||
* @returns {PointerEvent} | ||
*/ | ||
export default function createPointerEvent(target, eventType, x, y, identifier = 0) { | ||
return new PointerEvent(eventType, { | ||
identifier: identifier || 0, | ||
target, | ||
clientX: x, | ||
clientY: y, | ||
pointerType: ['touch'] | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as pan } from './pan'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<h2 id="title">Welcome to Ember</h2> | ||
|
||
{{outlet}} | ||
{{outlet}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Generates a mock PointerEvent like object for testing purposes | ||
* @param {string} eventType pointerdown, pointermove or pointerup | ||
* @param {number} x | ||
* @param {number} y | ||
* @param {number} timeStampDelta | ||
*/ | ||
export default function createMockPointerEvent(eventType, x, y, timeStampDelta = 0) { | ||
// we mock it using an object because we can't otherwise set the timeStamp | ||
return { | ||
type: eventType, | ||
identifier: Date.now(), | ||
target: document.body, | ||
clientX: x, | ||
clientY: y, | ||
timeStamp: 234011.29999995464 + timeStampDelta | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.