Load the dependency tabs on demand

This commit is contained in:
Eelco Dolstra 2013-02-20 18:13:20 +01:00
parent 36a1015444
commit 4552117e51

View file

@ -103,7 +103,7 @@
<td><tt>[% HTML.escape(build.releasename) %]</tt></td>
</tr>
[% ELSE %]
g <tr>
<tr>
<th>Nix name:</th>
<td><tt>[% build.nixname %]</tt></td>
</tr>
@ -508,18 +508,27 @@ g <tr>
[% IF drvAvailable %]
<div id="tabs-build-deps" class="tab-pane"><i class="icon-time icon-black"></i></div>
<script>
$('#tabs-build-deps').load("[% c.uri_for('/build' build.id 'build-deps') %]");
</script>
[% END %]
[% IF available %]
<div id="tabs-runtime-deps" class="tab-pane"><i class="icon-time icon-black"></i></div>
<script>
$('#tabs-runtime-deps').load("[% c.uri_for('/build' build.id 'runtime-deps') %]");
</script>
[% END %]
</div>
<script>
$(function() {
$('.nav-tabs').bind('show', function(e) {
var pattern = /#.+/gi;
var id = e.target.toString().match(pattern)[0];
if (id == "#tabs-runtime-deps") {
$('#tabs-runtime-deps').load("[% c.uri_for('/build' build.id 'runtime-deps') %]");
} else if (id == "#tabs-build-deps") {
$('#tabs-build-deps').load("[% c.uri_for('/build' build.id 'build-deps') %]");
}
});
});
</script>
[% END %]