diff --git a/src/privates.js b/src/privates.js index 95362ce..9c061a8 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 = wizard.triggerHandler("stepChanging", [state.currentIndex, index]); + if (changeState) { // 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"); } @@ -1240,4 +1241,4 @@ function validateArgument(argumentName, argumentValue) { throwError("The argument '{0}' is null or undefined.", argumentName); } -} \ No newline at end of file +}