Only show client properties if there's something to show.

This commit is contained in:
Simon MacMullen 2011-03-30 13:14:24 +01:00
parent b0dca51901
commit a2dee73c73
2 changed files with 10 additions and 0 deletions

View File

@ -347,3 +347,11 @@ function fmt_sort(display, sort) {
}
return '<a class="sort" sort="' + sort + '">' + prefix + display + '</a>';
}
function properties_size(obj) {
var count = 0;
for (k in obj) {
if (obj.hasOwnProperty(k)) count++;
}
return count;
}

View File

@ -131,12 +131,14 @@
</div>
<% } %>
<% if (properties_size(connection.client_properties) > 0) { %>
<div class="section-hidden">
<h2>Client Library</h2>
<div class="hider">
<%= fmt_table_long(connection.client_properties) %>
</div>
</div>
<% } %>
<div class="section-hidden">
<h2>Close This Connection</h2>