From: Raniere Silva Date: Sat, 6 May 2017 08:12:36 +0000 (+0100) Subject: Make challenges and discussion visibles X-Git-Url: https://git.arvados.org/rnaseq-cwl-training.git/commitdiff_plain/6f6cba4dfd9457e8e81a838f485b869dff2b242d 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. --- diff --git a/assets/js/lesson.js b/assets/js/lesson.js index c51dca6..185da92 100644 --- a/assets/js/lesson.js +++ b/assets/js/lesson.js @@ -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("");