Skip to content

Commit

Permalink
Avoid empty methods section in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Vicenti committed Mar 25, 2015
1 parent a7452c4 commit 00f2a7b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions website/layout/AutodocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
},

Expand All @@ -236,7 +242,6 @@ var APIDoc = React.createClass({
<Marked>
{this.removeCommentsFromDocblock(content.docblock)}
</Marked>
<H level={3}>Methods</H>
{this.renderMethods(content.methods)}
</div>
);
Expand Down

0 comments on commit 00f2a7b

Please sign in to comment.