Created
January 9, 2017 20:41
-
-
Save skylerto/74b37e7d874d4a4da4e4e415965e956e 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
<div class="container ... "> | |
<div class="component ... ${getStepClass(properties.step, 1)}"> | |
STEP 1 | |
</div> | |
<div class="component ... ${getStepClass(properties.step, 2)}"> | |
STEP 2 | |
</div> | |
<div class="component ... ${getStepClass(properties.step, 3)}"> | |
STEP 3 | |
</div> | |
<div class="component ... ${getStepClass(properties.step, 4)}"> | |
STEP 4 | |
</div> | |
</div> | |
<!-- This would actually go in a javascript file --> | |
<script type="text/javascript"> | |
/** | |
* Determine which css class to add. | |
* | |
* pageIndex - the actual step value from properties.step | |
* step - the step from the HTML. | |
*/ | |
function getStepClass(pageIndex, step) { | |
if (pageIndex < step) { | |
return 'completed'; | |
} else if (pageIndex === step) { | |
return 'active'; | |
} else { | |
return 'inactive'; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment