Mark optional and repeatable arguments

This commit is contained in:
Andreas Hocevar
2014-05-15 16:58:13 +02:00
parent fc88db53f6
commit b2554cab41
2 changed files with 8 additions and 18 deletions

View File

@@ -294,7 +294,7 @@ li {
.main table .description p {
margin: 0;
}
.main table .optional {
.main table .optional, .main table .repeatable {
float: left;
border-radius: 3px;
background-color: #ddd!important;

View File

@@ -24,9 +24,15 @@
var colspan = 2;
params.forEach(function(param) {
if (!param) { return; }
if (param.type && param.type.names && param.type.names.indexOf('undefined') !== -1) {
param.optional = true;
}
if (param.name.indexOf('var_') == 0) {
params.hasAttributes = true;
param.variable = true;
}
if (param.optional || param.nullable) {
++colspan;
params.hasAttributes = true;
}
@@ -50,10 +56,6 @@
<th>Type</th>
<?js if (params.hasAttributes) {?>
<th>Argument</th>
<?js } ?>
<?js if (params.hasDefault) {?>
<th>Default</th>
<?js } ?>
@@ -81,18 +83,6 @@
<?js } ?>
</td>
<?js if (params.hasAttributes) {?>
<td class="attributes">
<?js if (param.optional) { ?>
&lt;optional><br>
<?js } ?>
<?js if (param.nullable) { ?>
&lt;nullable><br>
<?js } ?>
</td>
<?js } ?>
<?js if (params.hasDefault) {?>
<td class="default">
<?js if (typeof param.defaultvalue !== 'undefined') { ?>