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:
@ -15,7 +15,7 @@
|
||||
|
||||
<p>The following projects are hosted on this server:</p>
|
||||
|
||||
<table class="tablesorter table table-condensed table-striped">
|
||||
<table class="tablesorter table table-condensed table-striped clickable-rows">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
@ -25,8 +25,8 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH p IN projects %]
|
||||
<tr onclick="window.location = '[% c.uri_for('/project' p.name) %]'">
|
||||
<td><span class="[% IF !p.enabled %]disabled-project[% END %] [%+ IF p.hidden %]hidden-project[% END %]">[% INCLUDE renderProjectName project = p.name %]</span></td>
|
||||
<tr>
|
||||
<td><span class="[% IF !p.enabled %]disabled-project[% END %] [%+ IF p.hidden %]hidden-project[% END %]">[% INCLUDE renderProjectName project=p.name inRow=1 %]</span></td>
|
||||
<td>[% HTML.escape(p.displayname) %]</td>
|
||||
<td>[% WRAPPER maybeLink uri=p.homepage %][% HTML.escape(p.description) %][% END %]</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user