Use changedTouches instead of touches.

This is because the "touchend" event removes the touch from
event.touches on iOS, but it can still be accessed via
event.changedTouches.
This commit is contained in:
Jason Davies 2011-10-25 09:12:42 +01:00
Родитель c0e5b96336
Коммит bd90a2f1bf
3 изменённых файлов: 3 добавлений и 3 удалений

2
d3.js поставляемый
Просмотреть файл

@ -3530,7 +3530,7 @@ function d3_svg_mousePoint(container, e) {
return [point.x, point.y];
};
d3.svg.touches = function(container) {
var touches = d3.event.touches;
var touches = d3.event.changedTouches;
return touches ? d3_array(touches).map(function(touch) {
var point = d3_svg_mousePoint(container, touch);
point.identifier = touch.identifier;

2
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,5 +1,5 @@
d3.svg.touches = function(container) {
var touches = d3.event.touches;
var touches = d3.event.changedTouches;
return touches ? d3_array(touches).map(function(touch) {
var point = d3_svg_mousePoint(container, touch);
point.identifier = touch.identifier;