From 954f7514144a281b73e9b47ac88a6b13e8799f31 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 15 Oct 2020 10:25:48 +0200 Subject: Reintroduce saemix helper functions --- vignettes/mkin.html | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'vignettes/mkin.html') diff --git a/vignettes/mkin.html b/vignettes/mkin.html index 8d9989a2..26de3deb 100644 --- a/vignettes/mkin.html +++ b/vignettes/mkin.html @@ -11,7 +11,7 @@ - + Introduction to mkin @@ -1283,26 +1283,26 @@ window.initializeCodeFolding = function(show) { var currentIndex = 1; // select all R code blocks - var rCodeBlocks = $('pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.julia'); + var rCodeBlocks = $('pre.r, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.julia, pre.foldable'); rCodeBlocks.each(function() { // create a collapsable div to wrap the code in var div = $('
'); - if (show || $(this)[0].classList.contains('fold-show')) - div.addClass('in'); + var showThis = (show || $(this).hasClass('fold-show')) && !$(this).hasClass('fold-hide'); + if (showThis) div.addClass('in'); var id = 'rcode-643E0F36' + currentIndex++; div.attr('id', id); $(this).before(div); $(this).detach().appendTo(div); // add a show code button right above - var showCodeText = $('' + (show ? 'Hide' : 'Code') + ''); + var showCodeText = $('' + (showThis ? 'Hide' : 'Code') + ''); var showCodeButton = $(''); showCodeButton.append(showCodeText); showCodeButton .attr('data-toggle', 'collapse') .attr('data-target', '#' + id) - .attr('aria-expanded', show) + .attr('aria-expanded', showThis) .attr('aria-controls', id); var buttonRow = $('
'); @@ -1344,6 +1344,15 @@ color: #d14; + +