Skip to content

Commit

Permalink
fixes #147 - isTouch and isPointerEventCompatible are both returning …
Browse files Browse the repository at this point in the history
…true in WindowsPhone devices. fixed the if clause
  • Loading branch information
Christian Tarabusi committed Dec 16, 2014
1 parent 7107123 commit 95eae6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pep",
"title": "jquery.pep.js",
"description": "Kinetic drag for mobile & desktop",
"version": "0.6.4",
"version": "0.6.5",
"homepage": "http://pep.briangonzalez.org",
"author": {
"name": "Brian Gonzalez",
Expand Down
18 changes: 10 additions & 8 deletions src/jquery.pep.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,14 @@
Pep.prototype.normalizeEvent = function(ev) {
ev.pep = {};

if ( this.isPointerEventCompatible() || !this.isTouch(ev) ) {
if ( this.isTouch(ev) ) {

ev.pep.x = ev.originalEvent.touches[0].pageX;
ev.pep.y = ev.originalEvent.touches[0].pageY;
ev.pep.type = ev.type;

}
else if ( this.isPointerEventCompatible() || !this.isTouch(ev) ) {

if ( ev.pageX ) {
ev.pep.x = ev.pageX;
Expand All @@ -524,13 +531,8 @@
ev.pep.type = ev.type;

}
else {
ev.pep.x = ev.originalEvent.touches[0].pageX;
ev.pep.y = ev.originalEvent.touches[0].pageY;
ev.pep.type = ev.type;
}

return ev;

return ev;
};

// resetVelocityQueue()
Expand Down

0 comments on commit 95eae6f

Please sign in to comment.