Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/generators/html/build/make_default_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,18 @@ module.exports = function(docMap, config, getCurrent, Handlebars){
}
return "";
},

/**
* @function documentjs.generators.html.defaultHelpers.ifIsLastItem
*
* Renders the truthy section if the current context is the last item
* in the list.
*
* @param {Array} list
* @param {*} item
*/
ifIsLastItem: function(list, item, options){
return list[list.length - 1] === item ? options.fn(this) : '';
},
//
makeApiSection: function(options){
var depth = (this.api && this.api !== this.name ? 1 : 0);
Expand Down
4 changes: 3 additions & 1 deletion site/default/templates/menu.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
{{makeTitle}}
</a>
{{#if ../active.hideChildrenInMenu}}
{{> active-menu.mustache}}
{{#ifIsLastItem ../../parents .}}
{{> active-menu.mustache}}
{{/ifIsLastItem}}
{{/if}}
</li>
{{/each}}
Expand Down