Move from Zebra striping to click-to-highlight
parent
0fa8343098
commit
8cf3386075
|
@ -23,7 +23,7 @@
|
|||
width: 30%;
|
||||
}
|
||||
|
||||
.the_table tr:nth-child(even) {
|
||||
.the_table tr.selected {
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
|
|
@ -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"]}} → {{run["estimate"]}}</td>
|
||||
<td>{{run["name"]}} <span class="de-emphasis">{{run["category"]}}</span></td>
|
||||
<td>{{run["runners"]}}</td>
|
||||
|
|
Loading…
Reference in New Issue