change relation.appendMember to use the undo system, and update various places as...
[potlatch2.git] / net / systemeD / potlatch2 / TagViewer.mxml
index 2b9b29359bbbc66c3f16c0b76854b2f152beb1cc..d40a1d59a1fd3232e762c178cc6400b579476cac 100644 (file)
           
           var conn:Connection = Connection.getConnectionInstance();
           var rel:Relation = selectedEntity as Relation
+          var action:CompositeUndoableAction = new CompositeUndoableAction("Rearrange relation members for "+rel);
           
           // drop members
           for (var i:int=rel.length-1 ; i>=0; i--) {
             } else if (memberObject.type == 'relation') {
               e = conn.getRelation(id);
             }
-            rel.appendMember(new RelationMember(e, memberObject.role));
+            rel.appendMember(new RelationMember(e, memberObject.role), action.push);
           }
+          MainUndoStack.getGlobalStack().addAction(action);
       }
       
       private function editRelation(id:Number):void {