domjudge icon indicating copy to clipboard operation
domjudge copied to clipboard

Make table rows instead of table cells clickable

Open RagnarGrootKoerkamp opened this issue 3 years ago • 2 comments

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.

RagnarGrootKoerkamp avatar Oct 16 '21 14:10 RagnarGrootKoerkamp

Ah, it seems that this actually isn't possible with native HTML, but datatables can probably do it: https://stackoverflow.com/q/25346476/2716069

RagnarGrootKoerkamp avatar Oct 16 '21 16:10 RagnarGrootKoerkamp

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?

nickygerritsen avatar Oct 16 '21 17:10 nickygerritsen

Closed with https://github.com/DOMjudge/domjudge/commit/122c545cd13a5ff96bba868cc5553679352099a9

vmcj avatar Oct 18 '23 21:10 vmcj