Download:
child 74:e0a1f3f2a7a3
parent 72:c6489ccdbd5b
73:a9c9da814fe3
Anton Shestakov <av6@dwimlabs.net>, Tue, 28 Jun 2016 18:52:52 +0800
viewer: setup and clone tasks without errors/warnings are collapsed by default In addition to errors and warnings, which leave task expanded, target line also does the same, so sharing a link to a specific line doesn't surprise people by hiding the line somewhere.

1 файлов изменено, 9 вставок(+), 2 удалений(-) [+]
templates/check.html file | annotate | diff | comparison | revisions
--- a/templates/check.html Mon Jun 27 22:58:22 2016 +0800
+++ b/templates/check.html Tue Jun 28 18:52:52 2016 +0800
@@ -59,11 +59,18 @@
var $header = $collapser.closest('div');
var task = $header.attr('data-task');
var $lines = $header.nextAll('[data-task="' + task + '"]');
+ var toggle = function() {
+ var collapsed = $collapser.hasClass('collapsed');
+ $lines.toggleClass('uk-hidden', collapsed);
+ };
$collapser.on('click', function() {
$collapser.toggleClass('collapsed');
- var collapsed = $collapser.hasClass('collapsed');
- $lines.toggleClass('uk-hidden', collapsed);
+ toggle();
});
+ if ((task == 'setup' || task == 'clone') && $lines.filter('.error, .warning, :target').length === 0) {
+ $collapser.addClass('collapsed');
+ toggle();
+ }
});
})(jQuery);
</script>