Skip to content
Snippets Groups Projects
Commit 6f6cba4d authored by Raniere Silva's avatar Raniere Silva
Browse files

Make challenges and discussion visibles

This is based on
https://github.com/swcarpentry/instructor-training/pull/437/files and
https://github.com/swcarpentry/instructor-training/pull/439/files,
both write by @ErinBecker.
parent 895499e6
No related merge requests found
......@@ -3,7 +3,7 @@ $("table").addClass("table table-striped");
// Handle foldable challenges and solutions (on click and at start).
$(".challenge,.discussion,.solution").click(function(event) {
$(".solution").click(function(event) {
var trigger = $(event.target).has(".fold-unfold").size() > 0
|| $(event.target).filter(".fold-unfold").size() > 0;
if (trigger) {
......@@ -12,7 +12,7 @@ $(".challenge,.discussion,.solution").click(function(event) {
event.stopPropagation();
}
});
$(".challenge,.discussion,.solution").each(function() {
$(".solution").each(function() {
$(">*:not(h2)", this).toggle();
var h2 = $("h2:first", this);
h2.append("<span class='fold-unfold glyphicon glyphicon-collapse-down'></span>");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment