Last active
November 22, 2017 22:01
-
-
Save Martin-Alexander/8d2509d6a7c0e8d6f5ac354dc8f55f95 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="btn-group mt-1 mx-auto"> | |
<button id="gantt-day" type="button" class="gantt-period btn btn-sm btn-secondary">Day</button> | |
<button id="gantt-week" type="button" class="gantt-period btn btn-sm btn-secondary">Week</button> | |
<button id="gantt-month" type="button" class="gantt-period btn btn-sm btn-secondary">Month</button> | |
</div> | |
<script> | |
document.querySelectorAll(".gantt-period").forEach(function(button) { | |
button.addEventListener("click", function(event) { | |
railsGantt.gantt.change_view_mode(event.currentTarget.innerHTML); | |
document.querySelectorAll(".gantt-period").forEach(function(button) { | |
button.classList.remove("active"); | |
}); | |
event.currentTarget.classList.add("active"); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment