Created
March 14, 2016 23:53
-
-
Save bassettsj/e23fb274cc7fcb84ba88 to your computer and use it in GitHub Desktop.
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
@autobind | |
onClick(e: SyntheticEvent): void { | |
e.preventDefault(); | |
const elTarget = e.currentTarget; | |
if (elTarget instanceof HTMLElement) { | |
const classList = elTarget.classList; | |
// only allow steps that are in the past or have errors to be edited | |
if (classList.contains('c--past') || classList.contains('c--error')) { | |
const stepID = parseInt(`${elTarget.dataset.id}`, 10); | |
this.props.onSelectStep(stepID); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment