Skip to content

Commit

Permalink
Closes #50
Browse files Browse the repository at this point in the history
  • Loading branch information
dima committed Dec 17, 2010
1 parent 730bdda commit 6b6e98a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions framework/src/org/restfulx/controllers/ChangeController.as
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,18 @@ package org.restfulx.controllers {
throw new Error("Push can be performed only if Rx.enableSync is true and source and destination providers are set");
}
errors = new RxCollection;
if (!models.length) models = Rx.models.state.models;
for each (var model:Class in models) {
source.dirty(model, new ItemResponder(onDirtyChanges, onDirtyFault));
}
if (!models.length) {
models = Rx.models.state.models;
}

if (models.length > 0) {
notifiedPushStart = true;
dispatchEvent(new PushStartEvent);
for each (var model:Class in models) {
source.dirty(model, new ItemResponder(onDirtyChanges, onDirtyFault));
}
}

}

/**
Expand Down Expand Up @@ -268,8 +276,6 @@ package org.restfulx.controllers {

// no undo-redo for synchronization, and the stack is lost after undo-redo
if (pushCount) {
dispatchEvent(new PushStartEvent);
notifiedPushStart = true;
if (!canUndoRedo) {
canUndoRedo = Rx.enableUndoRedo;
Rx.enableUndoRedo = false;
Expand Down

0 comments on commit 6b6e98a

Please sign in to comment.