Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
4ed915a2c0 |
@@ -1,7 +1,34 @@
|
||||
$ ->
|
||||
# run foundation scripts
|
||||
# let us know when javascript is running.
|
||||
console.log('Ready.')
|
||||
|
||||
lastColumn = null
|
||||
ascending = true
|
||||
|
||||
tableHeaders = $('th')
|
||||
tableHeaders.click (e) ->
|
||||
column = $(this).index()
|
||||
table = $(this).closest('table')
|
||||
|
||||
if column is lastColumn
|
||||
ascending = not ascending
|
||||
else
|
||||
ascending = true
|
||||
|
||||
lastColumn = column
|
||||
sortTable(table, column, ascending)
|
||||
|
||||
sortTable = (table, column, ascending) ->
|
||||
rows = table.find('tbody tr').get()
|
||||
|
||||
compareFunction = (a, b) ->
|
||||
res = a.cells[column].textContent.localeCompare b.cells[column].textContent
|
||||
if ascending then res else -res
|
||||
|
||||
rows.sort compareFunction
|
||||
$(rows).detach().appendTo(table.find('tbody'))
|
||||
return
|
||||
|
||||
averageResults = (results, decimals = 2) ->
|
||||
avgScore = 0
|
||||
minScore = Infinity
|
||||
|
@@ -8,9 +8,9 @@
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Test name</th>
|
||||
<th># Benchmarks</th>
|
||||
<th>Last Updated</th>
|
||||
<th data-sort="name">Test name</th>
|
||||
<th data-sort="benchmark-count"># Benchmarks</th>
|
||||
<th data-sort="updated'">Last Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
Reference in New Issue
Block a user