Avoid empty methods section in docs

This commit is contained in:
Eric Vicenti 2015-03-25 14:26:46 -07:00
parent a7452c4a5f
commit 00f2a7b016
1 changed files with 11 additions and 6 deletions

View File

@ -217,12 +217,18 @@ var APIDoc = React.createClass({
renderMethods: function(methods) {
if (!methods.length) {
return null;
}
return (
<div className="props">
{methods.filter((method) => {
return method.name[0] !== '_';
}).map(this.renderMethod)}
</div>
<span>
<H level={3}>Methods</H>
<div className="props">
{methods.filter((method) => {
return method.name[0] !== '_';
}).map(this.renderMethod)}
</div>
</span>
);
},
@ -236,7 +242,6 @@ var APIDoc = React.createClass({
<Marked>
{this.removeCommentsFromDocblock(content.docblock)}
</Marked>
<H level={3}>Methods</H>
{this.renderMethods(content.methods)}
</div>
);