Move from Zebra striping to click-to-highlight
parent
0fa8343098
commit
8cf3386075
|
@ -23,7 +23,7 @@
|
||||||
width: 30%;
|
width: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.the_table tr:nth-child(even) {
|
.the_table tr.selected {
|
||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
// custom javascript
|
// custom javascript
|
||||||
|
|
||||||
$( document ).ready(function() {
|
var elements = document.getElementsByClassName('run');
|
||||||
console.log('Sanity Check!');
|
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>
|
<th scope="col">Runners</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for run in runs %}
|
{% for run in runs %}
|
||||||
<tr class="{{run["class"]}}">
|
<tr class="run {{run["class"]}}">
|
||||||
<td>{{run["time"]}} → {{run["estimate"]}}</td>
|
<td>{{run["time"]}} → {{run["estimate"]}}</td>
|
||||||
<td>{{run["name"]}} <span class="de-emphasis">{{run["category"]}}</span></td>
|
<td>{{run["name"]}} <span class="de-emphasis">{{run["category"]}}</span></td>
|
||||||
<td>{{run["runners"]}}</td>
|
<td>{{run["runners"]}}</td>
|
||||||
|
|
Loading…
Reference in New Issue