projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ca097d
)
Adding touchOVER check to the pageX/Y
author
Kyle Baggott
<Kyle_Baggott@hotmail.co.uk>
Mon, 1 Feb 2016 21:38:56 +0000
(21:38 +0000)
committer
Kyle Baggott
<Kyle_Baggott@hotmail.co.uk>
Mon, 1 Feb 2016 21:38:56 +0000
(21:38 +0000)
Adding touchOVER check to the pageX/Y as it only exists under touches for touch events.
src/dygraph-utils.js
patch
|
blob
|
blame
|
history
diff --git
a/src/dygraph-utils.js
b/src/dygraph-utils.js
index
a960ba7
..
682c441
100644
(file)
--- a/
src/dygraph-utils.js
+++ b/
src/dygraph-utils.js
@@
-193,6
+193,7
@@
Dygraph.findPos = function(obj) {
* @private
*/
Dygraph.pageX = function(e) {
+ if (e.isTouchOver) return (!e.touches[0] || e.touches[0].pageX < 0) ? 0 : e.touches[0].pageX;
return (!e.pageX || e.pageX < 0) ? 0 : e.pageX;
};
@@
-205,6
+206,7
@@
Dygraph.pageX = function(e) {
* @private
*/
Dygraph.pageY = function(e) {
+ if (e.isTouchOver) return (!e.touches[0] || e.touches[0].pageY < 0) ? 0 : e.touches[0].pageY;
return (!e.pageY || e.pageY < 0) ? 0 : e.pageY;
};