Skip to content

Conversation

jonny-no1
Copy link

Pull request to close issue #26.

Based on: http://stackoverflow.com/a/26848549/2106834.

reset is a reserved word hence why I went for _reset.

@guidolx
Copy link

guidolx commented Sep 15, 2015

A minor fix to the method - imho you could add a check like this - had some weird behaviour on a form where all the steps are enabled (user can navigate back and forth )

if(state.currentIndex !== 0){
    goToStep(wizard, options, state, 0);
}

@DevNamedZed
Copy link

DevNamedZed commented Nov 3, 2017

We have it so they cannot go back after the last page. Added a flag to ignore the stepChanging flag when resetting

$.fn.steps.reset = function () {
    var wizard = this,
        options = getOptions(this),
        state = getState(this);

    
    if (state.currentIndex !== 0) {
        state.isResetting = true;
        goToStep(wizard, options, state, 0);
        state.isResetting = false;
    }

    for (i = 1; i < state.stepCount; i++) {
        var stepAnchor = getStepAnchor(wizard, i);
        stepAnchor.parent().removeClass("done")._enableAria(false);
    }
};
if (state.isResetting || wizard.triggerHandler("stepChanging", [state.currentIndex, index]))
    {

@jonny-no1
Copy link
Author

This project seems to be abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants