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) { if (d3.event.touches.length) {
touchtime = null; touchtime = null;
started(); 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() { 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() { function touchstarted() {
var target = this, var target = this,
event_ = event.of(target, arguments), event_ = event.of(target, arguments),
@ -132,6 +133,7 @@ d3.behavior.zoom = function() {
started(); started();
// Temporarily override touchstart while gesture is active.
function started() { function started() {
var now = Date.now(), var now = Date.now(),
touches = d3.touches(target); touches = d3.touches(target);
@ -179,13 +181,15 @@ d3.behavior.zoom = function() {
function ended() { function ended() {
if (d3.event.touches.length) { if (d3.event.touches.length) {
// Prevent spurious dbltap.
touchtime = null; touchtime = null;
// Gesture is still active; recompute positions using new scale.
started(); 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();
} }
} }