fix small relation issues
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / RouteEditor.mxml
index 9abe7e8fc1184c3953cda74d318d13095388f169..9599620301d0e36946870cc095c5e0b571bdebce 100644 (file)
             var icon:RouteIcon = new RouteIcon();
             icon.setRoute(relation, RouteEditorFactory(_factory).icon);
             
-            icon.addEventListener(MouseEvent.CLICK, function(event:Event):void {
-                trace(relation+" is clicked");
-                var panel:RelationEditorPanel = RelationEditorPanel(
-                    PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
-                panel.setRelation(relation);
-                PopUpManager.centerPopUp(panel);
-            });
+            icon.addEventListener(MouseEvent.CLICK, routeClicked);
             routeIcons.addChild(icon);
         }
     }
     
+    public function routeClicked(event:Event):void {
+        var relation:Relation = RouteIcon(event.currentTarget).route;
+        trace(relation+" is clicked");
+        var panel:RelationEditorPanel = RelationEditorPanel(
+            PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+        panel.setRelation(relation);
+        PopUpManager.centerPopUp(panel);
+    }
+    
   ]]></mx:Script>
 </edit:RelationMemberEditor>