remove routes from relations
authorRichard Fairhurst <richard@systemed.net>
Mon, 1 Nov 2010 10:56:43 +0000 (10:56 +0000)
committerRichard Fairhurst <richard@systemed.net>
Mon, 1 Nov 2010 10:56:43 +0000 (10:56 +0000)
net/systemeD/potlatch2/mapfeatures/editors/RouteIcon.mxml

index 5616f10..6eca2c7 100644 (file)
@@ -11,6 +11,8 @@
     <mx:ComboBox id="dir" color="black" dataProvider="{routeDirs}" selectedItem="{findSelected(role)}"
         click="event.stopPropagation()"
         change="setRole(dir.selectedItem.data)" />
+       <mx:Image source="@Embed('../../../../../embedded/delete.svg')" click='event.stopPropagation();removeFromRelation()'
+        buttonMode="true" useHandCursor="true" />
     
     <mx:Script><![CDATA[
     import net.systemeD.halcyon.connection.*;
         var member:RelationMember = new RelationMember(_route["entity"], role);
         _route["relation"].setMember(_route["index"], member);
     }
+
+       private function removeFromRelation():void {
+               _route["relation"].removeMember(_route["entity"], MainUndoStack.getGlobalStack().addAction);
+       }
     
     ]]></mx:Script>
 </mx:HBox>