Skip to content

Commit

Permalink
Fix probable bug in getXY with Presto Opera Mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
taye committed Sep 13, 2015
1 parent 8a22001 commit 5a3a850
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions interact.js
Expand Up @@ -643,7 +643,9 @@
}
}
// Opera Mobile handles the viewport and scrolling oddly
else if (isOperaMobile) {
else if (isOperaMobile
&& (pointer instanceof window.Event
|| (supportsTouch && window.Touch && pointer instanceof window.Touch))) {
getXY('screen', pointer, page);

page.x += window.scrollX;
Expand Down Expand Up @@ -671,9 +673,14 @@
client.y = pointer.clientY;
}
}
else {
else if (isOperaMobile
&& (pointer instanceof window.Event
|| (supportsTouch && window.Touch && pointer instanceof window.Touch))) {
// Opera Mobile handles the viewport and scrolling oddly
getXY(isOperaMobile? 'screen': 'client', pointer, client);
getXY('screen', pointer, client);
}
else {
getXY('client', pointer, client);
}

return client;
Expand Down

0 comments on commit 5a3a850

Please sign in to comment.