mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Properly remove popped node. Fixes #146
This commit is contained in:
@@ -297,3 +297,8 @@ button small {
|
||||
width:630px;
|
||||
font-size:100%;
|
||||
}
|
||||
|
||||
.commit-section {
|
||||
max-height:250px;
|
||||
overflow:scroll;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,8 @@ iD.modes.DrawRoad = function(way_id) {
|
||||
node = iD.modes._node(this.map.projection.invert(
|
||||
d3.mouse(surface.node())));
|
||||
}
|
||||
way.nodes.pop();
|
||||
var old = this.map.history.graph().entity(way.nodes.pop());
|
||||
this.map.perform(iD.actions.removeWayNode(way, old));
|
||||
way.nodes.push(node.id);
|
||||
this.map.perform(iD.actions.addWayNode(way, node));
|
||||
way.nodes = way.nodes.slice();
|
||||
|
||||
@@ -378,8 +378,8 @@ iD.Map = function(elem, connection) {
|
||||
}
|
||||
|
||||
function removeEntity(entity) {
|
||||
var parents = map.history.graph().parents(entity.id);
|
||||
parents
|
||||
// Remove this node from any ways that is a member of
|
||||
map.history.graph().parents(entity.id)
|
||||
.filter(function(d) { return d.type === 'way'; })
|
||||
.forEach(function(parent) {
|
||||
parent.nodes = _.without(parent.nodes, entity.id);
|
||||
|
||||
+3
-5
@@ -8,12 +8,12 @@ iD.commit = function() {
|
||||
|
||||
header.append('h2').text('Save Changes to OpenStreetMap');
|
||||
|
||||
var section = body.selectAll('div.section')
|
||||
var section = body.selectAll('div.commit-section')
|
||||
.data(['modify', 'delete', 'create'].filter(function(d) {
|
||||
return changes[d].length;
|
||||
}))
|
||||
.enter()
|
||||
.append('div').attr('class', 'section');
|
||||
.append('div').attr('class', 'commit-section');
|
||||
|
||||
section.append('h3').text(String)
|
||||
.append('small')
|
||||
@@ -26,9 +26,7 @@ iD.commit = function() {
|
||||
.enter()
|
||||
.append('li');
|
||||
|
||||
li.append('strong').text(function(d) {
|
||||
return d.type + ' ';
|
||||
});
|
||||
li.append('strong').text(function(d) { return d.type + ' '; });
|
||||
li.append('span')
|
||||
.text(function(d) {
|
||||
return iD.Util.friendlyName(d);
|
||||
|
||||
Reference in New Issue
Block a user