From 00f2a7b01660a85505193e08f84fa20d8ceda9f7 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Wed, 25 Mar 2015 14:26:46 -0700 Subject: [PATCH] Avoid empty methods section in docs --- website/layout/AutodocsLayout.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/website/layout/AutodocsLayout.js b/website/layout/AutodocsLayout.js index 24de3cbb4..5fd1adf29 100644 --- a/website/layout/AutodocsLayout.js +++ b/website/layout/AutodocsLayout.js @@ -217,12 +217,18 @@ var APIDoc = React.createClass({ renderMethods: function(methods) { + if (!methods.length) { + return null; + } return ( -
- {methods.filter((method) => { - return method.name[0] !== '_'; - }).map(this.renderMethod)} -
+ + Methods +
+ {methods.filter((method) => { + return method.name[0] !== '_'; + }).map(this.renderMethod)} +
+
); }, @@ -236,7 +242,6 @@ var APIDoc = React.createClass({ {this.removeCommentsFromDocblock(content.docblock)} - Methods {this.renderMethods(content.methods)} );