From 67030da811d171ea3bdb6418ad3c7907c355a15b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Jan 2015 08:16:12 -0500 Subject: [PATCH 1/2] Add support to neither move to next step nor raise an error on step change --- src/privates.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/privates.js b/src/privates.js index 95362ce..55a270e 100644 --- a/src/privates.js +++ b/src/privates.js @@ -440,7 +440,8 @@ function goToStep(wizard, options, state, index) } var oldIndex = state.currentIndex; - if (wizard.triggerHandler("stepChanging", [state.currentIndex, index])) + var changeState = null; + if (changeState = wizard.triggerHandler("stepChanging", [state.currentIndex, index])) { // Save new state state.currentIndex = index; @@ -455,7 +456,7 @@ function goToStep(wizard, options, state, index) wizard.triggerHandler("stepChanged", [index, oldIndex]); }); } - else + else if (changeState !== null) { wizard.find(".steps li").eq(oldIndex).addClass("error"); } From 961d7103cedf95130c3da5b4517a64bdaad095bb Mon Sep 17 00:00:00 2001 From: admgrn Date: Thu, 1 Jan 2015 08:38:58 -0500 Subject: [PATCH 2/2] Fixed assignment of change state --- src/privates.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/privates.js b/src/privates.js index 55a270e..9c061a8 100644 --- a/src/privates.js +++ b/src/privates.js @@ -440,8 +440,8 @@ function goToStep(wizard, options, state, index) } var oldIndex = state.currentIndex; - var changeState = null; - if (changeState = wizard.triggerHandler("stepChanging", [state.currentIndex, index])) + var changeState = wizard.triggerHandler("stepChanging", [state.currentIndex, index]); + if (changeState) { // Save new state state.currentIndex = index; @@ -1241,4 +1241,4 @@ function validateArgument(argumentName, argumentValue) { throwError("The argument '{0}' is null or undefined.", argumentName); } -} \ No newline at end of file +}