mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 17:52:55 +00:00
Merge branch 'master' of github.com:systemed/iD
This commit is contained in:
@@ -23,7 +23,8 @@ iD.behavior.drag = function () {
|
||||
var event = d3.dispatch("start", "move", "end"),
|
||||
origin = null,
|
||||
selector = '',
|
||||
filter = null;
|
||||
filter = null,
|
||||
keybinding = d3.keybinding('drag');
|
||||
|
||||
event.of = function(thiz, argumentz) {
|
||||
return function(e1) {
|
||||
@@ -135,6 +136,9 @@ iD.behavior.drag = function () {
|
||||
drag.off = function(selection) {
|
||||
selection.on("mousedown.drag" + selector, null)
|
||||
.on("touchstart.drag" + selector, null);
|
||||
keybinding
|
||||
.on('⌘+Z', null)
|
||||
.on('⌃+Z', null);
|
||||
};
|
||||
|
||||
drag.delegate = function(_) {
|
||||
@@ -155,5 +159,18 @@ iD.behavior.drag = function () {
|
||||
return drag;
|
||||
};
|
||||
|
||||
drag.cancel = function() {
|
||||
d3.select(window)
|
||||
.on("mousemove.drag", null)
|
||||
.on("mouseup.drag", null);
|
||||
return drag;
|
||||
};
|
||||
|
||||
keybinding
|
||||
.on('⌘+Z', drag.cancel)
|
||||
.on('⌃+Z', drag.cancel);
|
||||
|
||||
d3.select(document).call(keybinding);
|
||||
|
||||
return d3.rebind(drag, event, "on");
|
||||
};
|
||||
|
||||
@@ -14,7 +14,8 @@ iD.behavior.DragNode = function(mode) {
|
||||
.on('move', function(entity) {
|
||||
d3.event.sourceEvent.stopPropagation();
|
||||
history.replace(
|
||||
iD.actions.MoveNode(entity.id, projection.invert(d3.event.point)));
|
||||
iD.actions.MoveNode(entity.id, projection.invert(d3.event.point)),
|
||||
'moved a node');
|
||||
})
|
||||
.on('end', function() {
|
||||
history.replace(
|
||||
|
||||
@@ -17,7 +17,8 @@ iD.behavior.DragWay = function(mode) {
|
||||
.on('move', function(entity) {
|
||||
d3.event.sourceEvent.stopPropagation();
|
||||
history.replace(
|
||||
iD.actions.MoveWay(entity.id, d3.event.delta, projection));
|
||||
iD.actions.MoveWay(entity.id, d3.event.delta, projection),
|
||||
'moved a way');
|
||||
})
|
||||
.on('end', function() {
|
||||
history.replace(
|
||||
|
||||
Reference in New Issue
Block a user