diff --git a/config/jsdoc/api/template/publish.js b/config/jsdoc/api/template/publish.js index b7e37e11cd..cbed1b4997 100644 --- a/config/jsdoc/api/template/publish.js +++ b/config/jsdoc/api/template/publish.js @@ -214,35 +214,39 @@ function buildNav(members) { } return 0; }); + + function createEntry(type, v) { + return { + type: type, + longname: v.longname, + name: v.name, + classes: find({ + kind: 'class', + memberof: v.longname + }).map(createEntry.bind(this, 'class')), + members: find({ + kind: 'member', + memberof: v.longname + }), + methods: find({ + kind: 'function', + memberof: v.longname + }), + typedefs: find({ + kind: 'typedef', + memberof: v.longname + }), + events: find({ + kind: 'event', + memberof: v.longname + }) + }; + } _.each(merged, function(v) { // exclude interfaces from sidebar if (v.interface !== true) { if (v.kind == 'module') { - nav.push({ - type: 'module', - longname: v.longname, - name: v.name, - classes: find({ - kind: 'class', - memberof: v.longname - }), - members: find({ - kind: 'member', - memberof: v.longname - }), - methods: find({ - kind: 'function', - memberof: v.longname - }), - typedefs: find({ - kind: 'typedef', - memberof: v.longname - }), - events: find({ - kind: 'event', - memberof: v.longname - }) - }); + nav.push(createEntry('module', v)); } } }); diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index 85ead698e0..f1fcf5d560 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -12,13 +12,18 @@ $(function () { var $item = $(v); if ($item.data('name') && regexp.test($item.data('name'))) { + const container = $item.parent().parent().parent(); + container.show(); + container.closest('.itemMembers').show(); + container.closest('.item').show(); $item.show(); $item.closest('.itemMembers').show(); $item.closest('.item').show(); } }); } else { - $el.find('.item, .itemMembers').show(); + $el.find('.item, .itemMembers').hide(); + $('.navigation>ul>li').show(); } $el.find('.list').scrollTop(0); diff --git a/config/jsdoc/api/template/tmpl/navigation.tmpl b/config/jsdoc/api/template/tmpl/navigation.tmpl index 08c1df4a91..2e18305f21 100644 --- a/config/jsdoc/api/template/tmpl/navigation.tmpl +++ b/config/jsdoc/api/template/tmpl/navigation.tmpl @@ -10,11 +10,12 @@ function toShortName(name) {