Skip to content

Commit

Permalink
feat:set global title link if having only typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
minkyu-yi committed Nov 9, 2016
1 parent 24d3056 commit 6f31591
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ function buildNav(members) {

if (members.globals.length) {
var globalNav = '';
var useGlobalTitleLink = true;

members.globals.forEach(function(g) {
if ( !hasOwnProp.call(seen, g.longname) ) {
Expand All @@ -425,13 +426,14 @@ function buildNav(members) {
globalNav += '<li class="hidden">' + linkto(g.longname, g.name) + '</li>';
} else {
globalNav += '<li>' + linkto(g.longname, g.name) + '</li>';
useGlobalTitleLink = false;
}
}

seen[g.longname] = true;
});

if (!globalNav) {
if (!useGlobalTitleLink) {
// turn the heading into a link so you can actually get to the global page
nav += '<div class="lnb-api hidden"><h3>' + linkto('global', 'Global') + '</h3></div>';
}
Expand Down

0 comments on commit 6f31591

Please sign in to comment.