Make challenges and discussion visibles
authorRaniere Silva <raniere@rgaiacs.com>
Sat, 6 May 2017 08:12:36 +0000 (09:12 +0100)
committerRaniere Silva <raniere@rgaiacs.com>
Sat, 6 May 2017 08:12:36 +0000 (09:12 +0100)
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.

assets/js/lesson.js

index c51dca6498c33938938fa80ec57b7f67b26bd337..185da920220429f734256180b9d7baf41323d45e 100644 (file)
@@ -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>");