Add a few comments.
This commit is contained in:
Родитель
120fb558a6
Коммит
993017ff22
|
@ -1275,13 +1275,13 @@ 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);
|
w.on(touchmove, null).on(touchend, null);
|
||||||
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
|
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
|
||||||
dragRestore();
|
dragRestore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function mousewheeled() {
|
function mousewheeled() {
|
||||||
d3_eventPreventDefault();
|
d3_eventPreventDefault();
|
||||||
if (!translate0) translate0 = location(d3.mouse(this));
|
if (!translate0) translate0 = location(d3.mouse(this));
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -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,15 +181,17 @@ 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);
|
w.on(touchmove, null).on(touchend, null);
|
||||||
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
|
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
|
||||||
dragRestore();
|
dragRestore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function mousewheeled() {
|
function mousewheeled() {
|
||||||
d3_eventPreventDefault();
|
d3_eventPreventDefault();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче