Add the ability to select, but not edit, a background way
[potlatch2.git] / net / systemeD / potlatch2 / controller / ControllerState.as
index d635e461166e47bd516559d4a58fbbc930567fe0..0aeddaa6f05ce0c954500fb7efb9cbd658659228 100644 (file)
@@ -7,6 +7,7 @@ package net.systemeD.potlatch2.controller {
     import net.systemeD.potlatch2.collections.Imagery;
     import net.systemeD.potlatch2.EditController;
        import net.systemeD.potlatch2.save.SaveManager;
+       import net.systemeD.potlatch2.utils.SnapshotConnection;
        import flash.ui.Keyboard;
        import mx.controls.Alert;
        import mx.events.CloseEvent;
@@ -93,7 +94,10 @@ package net.systemeD.potlatch2.controller {
             var focus:Entity = getTopLevelFocusEntity(entity);
 
                        if ( paint && paint.isBackground ) {
-                               if ( event.type == MouseEvent.MOUSE_DOWN && ((event.shiftKey && event.ctrlKey) || event.altKey) ) {
+                if ( event.type == MouseEvent.MOUSE_DOWN && entity.connection is SnapshotConnection) {
+                    if (entity is Way) { return new SelectedBackgroundWay(entity as Way); }
+                    else if (entity is Node) { return new SelectedPOINode(entity as Node); }
+                } else if ( event.type == MouseEvent.MOUSE_DOWN && ((event.shiftKey && event.ctrlKey) || event.altKey) ) {
                                        // alt-click to pull data out of vector background layer
                                        var newEntity:Entity=paint.pullThrough(entity,editableLayer);
                                        if (entity is Way) { return new SelectedWay(newEntity as Way); }