X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fdygraph-utils.js;h=682c4410c957f3f0661a12f1258fde5730b72deb;hb=83008f0ac1a69feb8a23d489cd706b464e69646b;hp=a960ba7ae9349f4c9b9eeb2e9f112050960eef06;hpb=51fc2820e9e5423394175f481d7003e196718554;p=dygraphs.git diff --git a/src/dygraph-utils.js b/src/dygraph-utils.js index a960ba7..682c441 100644 --- 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; };