In testing on different devices it seems changedTouches is better supported cross platform, using this instead of the the touches object.
Roughly tested on iOS and Android.
* @private
*/
Dygraph.pageX = function(e) {
- if (e.isTouchOver) return (!e.touches[0] || e.touches[0].pageX < 0) ? 0 : e.touches[0].pageX;
+ if (e.isTouchOver) return (!e.changedTouches[0] || e.changedTouches[0].pageX < 0) ? 0 : e.changedTouches[0].pageX;
return (!e.pageX || e.pageX < 0) ? 0 : e.pageX;
};
* @private
*/
Dygraph.pageY = function(e) {
- if (e.isTouchOver) return (!e.touches[0] || e.touches[0].pageY < 0) ? 0 : e.touches[0].pageY;
+ if (e.isTouchOver) return (!e.changedTouches[0] || e.changedTouches[0].pageY < 0) ? 0 : e.changedTouches[0].pageY;
return (!e.pageY || e.pageY < 0) ? 0 : e.pageY;
};