--- a/templates/check.html Sun Jul 03 23:13:48 2016 +0800
+++ b/templates/check.html Sun Jul 03 23:15:56 2016 +0800
#}<div id="l{{ number }}"{% if 'task' in line %} data-task="{{ line['task'] }}"{% end %}{% if 'cls' in line %} class="{{ line['cls'] }}"{% end %}>{#
#}<a href="#l{{ number }}" class="lineno" data-line-number="{{ number }}"></a>{#
- #}{% if line.get('cls') == 'task' and line.get('task') != 'cleanup' %}{#
- #}<a class="collapser"></a>{#
- $('.check-log .collapser').each(function() {
- var $collapser = $(this);
- var $header = $collapser.closest('div');
- var task = $header.attr('data-task');
- var $lines = $header.nextAll('[data-task="' + task + '"]');
+ $('.check-log div.task').each(function() {
+ var task = $line.attr('data-task');
+ if (task == 'cleanup') { return; }
+ var $lines = $line.nextAll('[data-task="' + task + '"]');
+ if ($lines.length === 0) { return; }
+ var $collapser = $('<a>').addClass('collapser');
+ $line.append($collapser);
var toggle = function() {
var collapsed = $collapser.hasClass('collapsed');
$lines.toggleClass('uk-hidden', collapsed);