update route editors when entity joins a relation
[potlatch2.git] / net / systemeD / potlatch2 / mapfeatures / editors / RelationMemberEditor.as
index 8d371fb924447099d1b52dd2f0bbc35b07dafabe..f002cc20d0e7302f3125c0f12a67ec1a73505f12 100644 (file)
@@ -62,11 +62,12 @@ package net.systemeD.potlatch2.mapfeatures.editors {
       public function set entity(entity:Entity):void {
           _entity = entity;
           
-          // TODO: we need to listen for add/removal and relation tag changes
+          entity.addEventListener(Connection.ADDED_TO_RELATION, relationsChanged);
+          entity.addEventListener(Connection.REMOVED_FROM_RELATION, relationsChanged);
           dispatchEvent(new Event("relations_changed"));
       }
       
-      private function relationsChanged(event:TagEvent):void {
+      protected function relationsChanged(event:Event):void {
           dispatchEvent(new Event("relations_changed"));
       }