Make statistics tables (in HTML view) togglable

The HTML view of the statistics channel creates
pages with many long tables.  These can be difficult
to navigate.

This commit adds a "show/hide" toggle to each
heading, which makes it easy to compress/expand
the view.
This commit is contained in:
Timothe Litt 2019-05-14 17:21:56 -04:00 committed by Ondřej Surý
parent d807ecde24
commit 86595ed8cb

View file

@ -21,6 +21,8 @@
var wid=0;
$('table.zones').each(function(i) { if( $(this).width() > wid ) wid = $(this).width(); return true; });
$('table.zones').css('min-width', wid );
$("h2+table,h3+table,h4+table").prev().append(' <a class="tabletoggle" href="#" style="font-size:small">Show/Hide</a>');
$(".tabletoggle").click(function(){ $(this).closest("h2,h3,h4").next().toggleClass("hidden"); return false;});
});
</script>
@ -90,6 +92,10 @@
font-size: 10pt;
}
.hidden{
display: none;
}
.odd{
background-color: #f0f0f0;
}