mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
Don't delete ways from route/boundary relations
This commit is contained in:
committed by
John Firebaugh
parent
5561ebdb14
commit
0953475f04
@@ -86,6 +86,7 @@ en:
|
||||
relation: Deleted a relation.
|
||||
multiple: "Deleted {n} objects."
|
||||
incomplete_relation: This feature can't be deleted because it hasn't been fully downloaded.
|
||||
part_of_relation: This feature can't be deleted because it's part of a larger relation. You must remove it from the relation first.
|
||||
connected_to_hidden: This can't be deleted because it is connected to a hidden feature.
|
||||
add_member:
|
||||
annotation: Added a member to a relation.
|
||||
|
||||
1
dist/locales/en.json
vendored
1
dist/locales/en.json
vendored
@@ -110,6 +110,7 @@
|
||||
"multiple": "Deleted {n} objects."
|
||||
},
|
||||
"incomplete_relation": "This feature can't be deleted because it hasn't been fully downloaded.",
|
||||
"part_of_relation": "This feature can't be deleted because it's part of a larger relation. You must remove it from the relation first.",
|
||||
"connected_to_hidden": "This can't be deleted because it is connected to a hidden feature."
|
||||
},
|
||||
"add_member": {
|
||||
|
||||
@@ -31,8 +31,17 @@ iD.actions.DeleteWay = function(wayId) {
|
||||
return graph.remove(way);
|
||||
};
|
||||
|
||||
action.disabled = function() {
|
||||
return false;
|
||||
action.disabled = function(graph) {
|
||||
var way = graph.entity(wayId);
|
||||
var reltypes = ['route','boundary'];
|
||||
var disabled = false;
|
||||
graph.parentRelations(way)
|
||||
.forEach(function(parent) {
|
||||
if (reltypes.indexOf(parent.tags.type)>-1) {
|
||||
disabled = 'part_of_relation';
|
||||
}
|
||||
});
|
||||
return disabled;
|
||||
};
|
||||
|
||||
return action;
|
||||
|
||||
Reference in New Issue
Block a user