Skip to content

Instantly share code, notes, and snippets.

@axdemelas
Last active June 12, 2016 18:01
Show Gist options
  • Save axdemelas/ee637f56dcac8313e1ff to your computer and use it in GitHub Desktop.
Save axdemelas/ee637f56dcac8313e1ff to your computer and use it in GitHub Desktop.
Example of onstepback custom event
var stepperElement = document.querySelector('.mdl-stepper');
// Get the MaterialStepper instance of element.
var Stepper = stepperElement.MaterialStepper;
// Select any step other than the first (for obvious reasons).
var step = element.querySelector('.mdl-step:nth-child(2)');
step.addEventListener('onstepback', function (event) {
// When the step (this) action button/link with [data-stepper-back] attribute is clicked
// you can call the back() method or do anything else.
Stepper.back();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment