Move from Zebra striping to click-to-highlight

main
Ryan Rix 2017-07-01 19:48:59 -07:00
parent 0fa8343098
commit 8cf3386075
3 changed files with 12 additions and 5 deletions

View File

@ -23,7 +23,7 @@
width: 30%;
}
.the_table tr:nth-child(even) {
.the_table tr.selected {
background-color: #efefef;
}

View File

@ -1,5 +1,12 @@
// custom javascript
$( document ).ready(function() {
console.log('Sanity Check!');
});
var elements = document.getElementsByClassName('run');
for (idx in elements) {
var element = elements[idx];
element.onclick = toggleRow;
}
function toggleRow(e) {
var row = e.currentTarget;
row.className == "run selected" ? row.className = "run" : row.className = "run selected"
}

View File

@ -13,7 +13,7 @@
<th scope="col">Runners</th>
</tr>
{% for run in runs %}
<tr class="{{run["class"]}}">
<tr class="run {{run["class"]}}">
<td>{{run["time"]}} &rarr; {{run["estimate"]}}</td>
<td>{{run["name"]}} <span class="de-emphasis">{{run["category"]}}</span></td>
<td>{{run["runners"]}}</td>