Optimise clickable rows

Set a click handler on the table instead of on every row.  This should
be faster on large tables.  Also, it's easier to use: you just set the
clickable-rows class on the table, and the row-link class on the <a>
element that contains the "main" link of the row.
This commit is contained in:
Eelco Dolstra
2013-02-22 18:05:04 +01:00
parent bd7be1cb84
commit 9422c9d2a7
7 changed files with 34 additions and 29 deletions

View File

@ -32,7 +32,7 @@ install the package simply by clicking on the packages below.</p>
<p>This channel contains the following packages.</p>
<table class="tablesorter table table-condensed table-striped">
<table class="tablesorter table table-condensed table-striped clickable-rows">
<thead>
<tr>
@ -50,9 +50,9 @@ install the package simply by clicking on the packages below.</p>
[% b = pkg.build %]
[% uri = "${curUri}/pkg/${pkg.name}.nixpkg" %]
<tr onclick="window.location = '[% uri %]'">
<tr>
<td><a href="[% c.uri_for('/build' b.id) %]">[% b.id %]</a></td>
<td><a href="[% uri %]"><tt>[% b.get_column('releasename') || b.nixname %]</tt></a></td>
<td><a class="row-link" href="[% uri %]"><tt>[% b.get_column('releasename') || b.nixname %]</tt></a></td>
<td><tt>[% b.system %]</tt></td>
<td>
[% IF b.homepage %]