Skip to content

Commit

Permalink
reset for nest Flow object
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoazhen committed Dec 3, 2013
1 parent 605003e commit 1c8c17a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text = auto
#https://help.github.com/articles/dealing-with-line-endings#per-repository-settings
* text=auto
8 changes: 8 additions & 0 deletions src/Flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@

p.reset = function () {
this.index = -1;

each(this.steps, function (step) {
if (isFlow(step)) {
step.reset();
}
});

return this;
};

// Run this step and keep current process
Expand Down
8 changes: 8 additions & 0 deletions src/Flow_underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@

p.reset = function () {
this.index = -1;

each(this.steps, function (step) {
if (isFlow(step)) {
step.reset();
}
});

return this;
};

// Run this step and keep current process
Expand Down

0 comments on commit 1c8c17a

Please sign in to comment.