Last active
June 12, 2016 18:01
-
-
Save axdemelas/ee637f56dcac8313e1ff to your computer and use it in GitHub Desktop.
Example of onstepback custom event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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