This commit is contained in:
Jason Davies 2013-07-31 21:28:41 +01:00
Родитель 120fb558a6
Коммит 993017ff22
3 изменённых файлов: 13 добавлений и 9 удалений

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

@ -1275,11 +1275,11 @@ d3 = function() {
if (d3.event.touches.length) {
touchtime = null;
started();
return;
} else {
w.on(touchmove, null).on(touchend, null);
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
dragRestore();
}
w.on(touchmove, null).on(touchend, null);
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
dragRestore();
}
}
function mousewheeled() {

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

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

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

@ -119,6 +119,7 @@ d3.behavior.zoom = function() {
}
}
// These closures persist for as long as at least one touch is active.
function touchstarted() {
var target = this,
event_ = event.of(target, arguments),
@ -132,6 +133,7 @@ d3.behavior.zoom = function() {
started();
// Temporarily override touchstart while gesture is active.
function started() {
var now = Date.now(),
touches = d3.touches(target);
@ -179,13 +181,15 @@ d3.behavior.zoom = function() {
function ended() {
if (d3.event.touches.length) {
// Prevent spurious dbltap.
touchtime = null;
// Gesture is still active; recompute positions using new scale.
started();
return;
} else {
w.on(touchmove, null).on(touchend, null);
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
dragRestore();
}
w.on(touchmove, null).on(touchend, null);
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
dragRestore();
}
}