From ea7f00b4639e811886125e064413faf311db0305 Mon Sep 17 00:00:00 2001 From: madhu72 Date: Fri, 16 Jun 2017 12:09:58 +0530 Subject: [PATCH 1/3] Added method to support setStep to nth step To support navigation to a specific step this method added --- src/privates.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/privates.js b/src/privates.js index 95362ce..66c1e11 100644 --- a/src/privates.js +++ b/src/privates.js @@ -309,6 +309,22 @@ function getStep(wizard, index) return steps[index]; } +/** + * sets a specific step object by index. + * + * @static + * @private + * @method setStep + * @param index {Integer} An integer that belongs to the position of a step + * @return {Boolean} Indicates whether the action executed + **/ +function setStep(wizard, index) +{ + var options = getOptions(wizard), + state = getState(wizard); + return paginationClick(wizard, options, state, index); +} + /** * Gets or creates if not exist an unique id from the given wizard instance. * @@ -1240,4 +1256,4 @@ function validateArgument(argumentName, argumentValue) { throwError("The argument '{0}' is null or undefined.", argumentName); } -} \ No newline at end of file +} From 5dc1c93937a66d202cbb19bbadfeaf91d9fedcff Mon Sep 17 00:00:00 2001 From: madhu72 Date: Fri, 16 Jun 2017 12:21:22 +0530 Subject: [PATCH 2/3] Update to public js to support setStep Changes added to support setStep method to change to a specific step --- src/publics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/publics.js b/src/publics.js index 9a80050..eb031a5 100644 --- a/src/publics.js +++ b/src/publics.js @@ -155,7 +155,7 @@ $.fn.steps.remove = function (index) **/ $.fn.steps.setStep = function (index, step) { - throw new Error("Not yet implemented!"); + return setStep(this,index); }; /** @@ -168,4 +168,4 @@ $.fn.steps.setStep = function (index, step) $.fn.steps.skip = function (count) { throw new Error("Not yet implemented!"); -}; \ No newline at end of file +}; From 7442e071d0c5f7acccf2632f65faed61fc9005e0 Mon Sep 17 00:00:00 2001 From: madhu72 Date: Fri, 16 Jun 2017 12:25:55 +0530 Subject: [PATCH 3/3] support of setStep method support to setStep method to navigate to a specific step dynamically --- src/privates.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/privates.js b/src/privates.js index 66c1e11..6329444 100644 --- a/src/privates.js +++ b/src/privates.js @@ -309,22 +309,6 @@ function getStep(wizard, index) return steps[index]; } -/** - * sets a specific step object by index. - * - * @static - * @private - * @method setStep - * @param index {Integer} An integer that belongs to the position of a step - * @return {Boolean} Indicates whether the action executed - **/ -function setStep(wizard, index) -{ - var options = getOptions(wizard), - state = getState(wizard); - return paginationClick(wizard, options, state, index); -} - /** * Gets or creates if not exist an unique id from the given wizard instance. * @@ -1147,6 +1131,22 @@ function saveCurrentStateToCookie(wizard, options, state) } } +/** + * sets a specific step object by index. + * + * @static + * @private + * @method setStep + * @param index {Integer} An integer that belongs to the position of a step + * @return {Boolean} Indicates whether the action executed + **/ +function setStep(wizard, index) +{ + var options = getOptions(wizard), + state = getState(wizard); + return paginationClick(wizard, options, state, index); +} + function startTransitionEffect(wizard, options, state, index, oldIndex, doneCallback) { var stepContents = wizard.find(".content > .body"),