Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/privates.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,26 @@ function destroy(wizard, options)
return wizardSubstitute;
}

/**
* Routes to first step and resets state.
*
* @static
* @private
* @method reset
*/
function _reset(wizard, options)
{
var state = getState(wizard),
i;

goToStep(wizard, options, state, 0);

for (i = 1; i < state.stepCount; i++) {
var stepAnchor = getStepAnchor(wizard, i);
stepAnchor.parent().removeClass("done")._enableAria(false);
}
}

/**
* Triggers the onFinishing and onFinished event.
*
Expand Down
11 changes: 11 additions & 0 deletions src/publics.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ $.fn.steps.destroy = function ()
return destroy(this, getOptions(this));
};

/**
* Routes to first step and resets state.
*
* @method reset
* @chainable
**/
$.fn.steps.reset = function ()
{
return _reset(this, getOptions(this));
};

/**
* Triggers the onFinishing and onFinished event.
*
Expand Down