Permalink
Browse files

Make node->way delete work with the toolbox too

  • Loading branch information...
1 parent c24b6a6 commit 281ed12b838f958355d5548aae811616577d2dc5 @systemed systemed committed Mar 6, 2012
Showing with 7 additions and 8 deletions.
  1. +7 −8 net/systemeD/potlatch2/Toolbox.mxml
@@ -224,16 +224,15 @@
// Individual toolbox actions
public function doDelete():void {
- var undo:CompositeUndoableAction = new CompositeUndoableAction("Delete objects");
- for each (var entity:Entity in controller.state.selection) {
- if (entity is Node) { entity.connection.unregisterPOI(Node(entity)); }
- entity.remove(undo.push);
- }
- MainUndoStack.getGlobalStack().addAction(undo);
-
if (controller.state is SelectedWayNode) {
- controller.setState(new SelectedWay(SelectedWayNode(controller.state).selectedWay));
+ controller.setState(SelectedWayNode(controller.state).deleteNode());
} else {
+ var undo:CompositeUndoableAction = new CompositeUndoableAction("Delete objects");
+ for each (var entity:Entity in controller.state.selection) {
+ if (entity is Node) { entity.connection.unregisterPOI(Node(entity)); }
+ entity.remove(undo.push);
+ }
+ MainUndoStack.getGlobalStack().addAction(undo);
controller.setState(new NoSelection());
}
}

0 comments on commit 281ed12

Please sign in to comment.