better Save button detection
[potlatch2.git] / net / systemeD / halcyon / connection / UndoableEntityAction.as
index 0dc9cfc6e1d87804d69ea3ed40d89236fcacd11c..2f5d1f97244711335099d9a34845f530f4639f61 100644 (file)
@@ -1,7 +1,8 @@
 package net.systemeD.halcyon.connection {
 
     public class UndoableEntityAction extends UndoableAction {
-        private var wasDirty:Boolean;
+        public var wasDirty:Boolean;
+               public var connectionWasDirty:Boolean;
         protected var name:String;
         protected var entity:Entity;
             
@@ -11,14 +12,23 @@ package net.systemeD.halcyon.connection {
         }
             
         protected function markDirty():void {
+                       var conn:Connection = Connection.getConnectionInstance();
             wasDirty = entity.isDirty;
+                       connectionWasDirty = conn.isDirty;
+
             if ( !wasDirty )
                 entity.markDirty();
+
+            if ( !connectionWasDirty )
+                conn.markDirty();
         }
             
         protected function markClean():void {
             if ( !wasDirty )
                 entity.markClean(entity.id, entity.version);
+
+            if ( !connectionWasDirty )
+                Connection.getConnectionInstance().markClean();
         }
             
         public function toString():String {