don't show "type" section if there are no types to display (#195)

This commit is contained in:
Jeff Williams 2012-09-22 11:22:01 -07:00
parent c890b0cf79
commit add0b09638
6 changed files with 16 additions and 19 deletions

View File

@ -4,13 +4,13 @@
</div>
<?js } ?>
<?js if (data.type) {?>
<?js if (data.type && data.type.names) {?>
<dl>
<dt>
Type
</dt>
<dd>
<?js= self.partial('type.tmpl', data.type) ?>
<?js= self.partial('type.tmpl', data.type.names) ?>
</dd>
</dl>
<?js } ?>

View File

@ -14,11 +14,11 @@
</div>
<?js } ?>
<?js if (kind === 'event' && data.type) {?>
<?js if (kind === 'event' && data.type && data.type.names) {?>
<h5>Type:</h5>
<ul>
<li>
<?js= self.partial('type.tmpl', data.type) ?>
<?js= self.partial('type.tmpl', data.type.names) ?>
</li>
</ul>
<?js } ?>

View File

@ -72,8 +72,8 @@
<?js } ?>
<td class="type">
<?js if (param.type) {?>
<?js= self.partial('type.tmpl', param.type) ?>
<?js if (param.type && param.type.names) {?>
<?js= self.partial('type.tmpl', param.type.names) ?>
<?js } ?>
</td>

View File

@ -72,8 +72,8 @@
<?js } ?>
<td class="type">
<?js if (prop.type) {?>
<?js= self.partial('type.tmpl', prop.type) ?>
<?js if (prop.type && prop.type.names) {?>
<?js= self.partial('type.tmpl', prop.type.names) ?>
<?js } ?>
</td>

View File

@ -4,13 +4,13 @@
</div>
<?js } ?>
<?js if (data.type) {?>
<?js if (data.type && data.type.names) {?>
<dl>
<dt>
Type
</dt>
<dd>
<?js= this.partial('type.tmpl', data.type) ?>
<?js= this.partial('type.tmpl', data.type.names) ?>
</dd>
</dl>
<?js } ?>

View File

@ -1,9 +1,6 @@
<?js if (data.names) { ?>
<?js
var names = data.names,
self = this;
names.forEach(function(name, i) { ?>
var self = this;
data.forEach(function(name, i) { ?>
<span class="param-type"><?js= self.linkto(name, self.htmlsafe(name)) ?></span>
<?js if (i < names.length-1) { ?>|<?js } ?>
<?js if (i < data.length-1) { ?>|<?js } ?>
<?js }); ?>
<?js } ?>