Last active
June 12, 2016 17:53
-
-
Save axdemelas/ffc89270f5273f3bfaea to your computer and use it in GitHub Desktop.
Example of onstepskip 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 element = document.querySelector('.mdl-stepper'); | |
// Get the MaterialStepper instance of element. | |
var Stepper = element.MaterialStepper; | |
// Select any optional step. | |
var optionalStep = element.querySelector('.mdl-step.mdl-step--optional'); | |
optionalStep.addEventListener('onstepskip', function (event) { | |
// When the step (this) action button/link with [data-stepper-skip] attribute is clicked | |
// you can call the skip() method or do anything else. | |
var skipped = Stepper.skip(); | |
if (!skipped) { | |
alert('This step cannot be skipped'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment