diff --git a/assets/js/template-helpers/isEmptyNode.js b/assets/js/template-helpers/isEmptyNode.js
new file mode 100644
index 000000000..131b9378d
--- /dev/null
+++ b/assets/js/template-helpers/isEmptyNode.js
@@ -0,0 +1,17 @@
+export default function (node, options) {
+ var nodeItems = [
+ node.headers,
+ node.types,
+ node.functions,
+ node.macros,
+ node.callbacks
+ ]
+
+ for (var i = 0; i < nodeItems.length; i++) {
+ if (Array.isArray(nodeItems[i]) && (nodeItems[i].length > 0)) {
+ return options.inverse(this)
+ }
+ }
+
+ return options.fn(this)
+}
diff --git a/assets/js/templates/sidebar-items.handlebars b/assets/js/templates/sidebar-items.handlebars
index 6ab476ea4..44320a015 100644
--- a/assets/js/templates/sidebar-items.handlebars
+++ b/assets/js/templates/sidebar-items.handlebars
@@ -8,76 +8,79 @@
{{!-- When visiting a module page, the link to this module page
in the menu should not link to a new page, instead should link
to the top of the page itself. --}}
+ {{#isEmptyNode node}}
+ {{node.title}}
+ {{else}}
+ {{node.title}}
- {{node.title}}
-
-
- -
- Top
-
-
- {{#isArray node.headers}}
- {{#each node.headers}}
- -
- {{id}}
-
- {{/each}}
- {{else}}
- {{#showSummary node}}
+
-
- Summary
+ Top
- {{/showSummary}}
- {{#if node.types}}
- -
- Types
-
- {{#each node.types}}
- -
- {{id}}
-
- {{/each}}
-
-
- {{/if}}
- {{#if node.functions}}
- -
- Functions
-
- {{#each node.functions}}
- -
- {{id}}
-
- {{/each}}
-
-
- {{/if}}
- {{#if node.macros}}
- -
- Macros
-
- {{#each node.macros}}
- -
- {{id}}
-
- {{/each}}
-
-
- {{/if}}
- {{#if node.callbacks}}
- -
- Callbacks
-
- {{#each node.callbacks}}
- -
- {{id}}
-
- {{/each}}
-
-
- {{/if}}
- {{/isArray}}
-
+
+ {{#isArray node.headers}}
+ {{#each node.headers}}
+ -
+ {{id}}
+
+ {{/each}}
+ {{else}}
+ {{#showSummary node}}
+ -
+ Summary
+
+ {{/showSummary}}
+ {{#if node.types}}
+ -
+ Types
+
+ {{#each node.types}}
+ -
+ {{id}}
+
+ {{/each}}
+
+
+ {{/if}}
+ {{#if node.functions}}
+ -
+ Functions
+
+ {{#each node.functions}}
+ -
+ {{id}}
+
+ {{/each}}
+
+
+ {{/if}}
+ {{#if node.macros}}
+ -
+ Macros
+
+ {{#each node.macros}}
+ -
+ {{id}}
+
+ {{/each}}
+
+
+ {{/if}}
+ {{#if node.callbacks}}
+ -
+ Callbacks
+
+ {{#each node.callbacks}}
+ -
+ {{id}}
+
+ {{/each}}
+
+
+ {{/if}}
+ {{/isArray}}
+
+ {{/isEmptyNode}}
{{/each}}