mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-28 10:51:45 +02:00
prevent dragging existing, prevent deleting existing
This commit is contained in:
@@ -7,6 +7,11 @@ export function actionDeleteNode(nodeId) {
|
||||
var action = function(graph) {
|
||||
var node = graph.entity(nodeId);
|
||||
|
||||
// Prevent deletion of existing nodes (anti-vandalism)
|
||||
if (node.version) {
|
||||
throw new Error('Deletion of existing features is not allowed.');
|
||||
}
|
||||
|
||||
graph.parentWays(node)
|
||||
.forEach(function(parent) {
|
||||
parent = parent.removeNode(nodeId);
|
||||
|
||||
Reference in New Issue
Block a user