domjudge
domjudge copied to clipboard
Make table rows instead of table cells clickable
In many places only table cells are click targets to open the submission/clarification/... . This is annoying, because the space in between cells isn't clickable. Worse, when one cell has a larger height (because of lines wrapping, i.e. the green/red testcase run squares), the other cells don't grow in height and only a small part of the row is actually clickable.
One problem with making the row clickable is that buttons inside the row may be a bit more tricky, for example when hovering the claim
button on a submission, the mouse won't change shape, but the button will still change to grey on hover.
Ah, it seems that this actually isn't possible with native HTML, but datatables can probably do it: https://stackoverflow.com/q/25346476/2716069
We could set something like data-link
on the <tr>
and then do something like:
$('tr[data-link]').on('click', function() {
window.location = $(this).data('link');
});
That should work. We could also automatically find an <a>
inside the row, but what if we have multiple?
Closed with https://github.com/DOMjudge/domjudge/commit/122c545cd13a5ff96bba868cc5553679352099a9