From 1c8c17a70c687729047a69becdee16e52da7141b Mon Sep 17 00:00:00 2001 From: Zane Yao Date: Tue, 3 Dec 2013 10:53:22 +0800 Subject: [PATCH] reset for nest Flow object --- .gitattributes | 3 ++- src/Flow.js | 8 ++++++++ src/Flow_underscore.js | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 4d4d7ef..c398f7b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -* text = auto \ No newline at end of file +#https://help.github.com/articles/dealing-with-line-endings#per-repository-settings +* text=auto \ No newline at end of file diff --git a/src/Flow.js b/src/Flow.js index 9545109..ab96150 100644 --- a/src/Flow.js +++ b/src/Flow.js @@ -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 diff --git a/src/Flow_underscore.js b/src/Flow_underscore.js index 232b96f..f4766ac 100644 --- a/src/Flow_underscore.js +++ b/src/Flow_underscore.js @@ -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