mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-03 09:53:40 +00:00
Fix dragging selected features. Fixes #271
This commit is contained in:
@@ -4,6 +4,7 @@ iD.modes._dragFeatures = function(mode) {
|
||||
var dragbehavior = d3.behavior.drag()
|
||||
.origin(function(entity) {
|
||||
var p = mode.map.projection(entity.loc);
|
||||
d3.event.sourceEvent.stopPropagation();
|
||||
return { x: p[0], y: p[1] };
|
||||
})
|
||||
.on('drag', function(entity) {
|
||||
|
||||
@@ -11,8 +11,6 @@ iD.modes.Select = function (entity) {
|
||||
return { x: p[0], y: p[1] };
|
||||
})
|
||||
.on('drag', function(entity) {
|
||||
if (!mode.map.dragEnable()) return;
|
||||
|
||||
d3.event.sourceEvent.stopPropagation();
|
||||
|
||||
if (!dragging) {
|
||||
@@ -32,7 +30,7 @@ iD.modes.Select = function (entity) {
|
||||
});
|
||||
})
|
||||
.on('dragend', function () {
|
||||
if (!mode.map.dragEnable() || !dragging) return;
|
||||
if (!dragging) return;
|
||||
dragging = undefined;
|
||||
mode.map.redraw();
|
||||
});
|
||||
@@ -53,6 +51,8 @@ iD.modes.Select = function (entity) {
|
||||
target = mode.map.surface.selectAll("*")
|
||||
.filter(function (d) { return d === entity; });
|
||||
|
||||
iD.modes._dragFeatures(mode);
|
||||
|
||||
d3.select('.inspector-wrap')
|
||||
.style('display', 'block')
|
||||
.style('opacity', 1)
|
||||
@@ -99,6 +99,7 @@ iD.modes.Select = function (entity) {
|
||||
.on('touchstart.drag', null);
|
||||
}
|
||||
|
||||
mode.map.surface.on('mousedown.latedrag', null);
|
||||
mode.map.surface.on("click.browse", null);
|
||||
mode.map.keybinding().on('⌫.browse', null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user