From 064dec21c403b40cd1550e591daa7f67584fb389 Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Tue, 6 Dec 2011 23:31:05 +0000 Subject: [PATCH] Fix for issue that caused the type text of a member to not link to the class docs. --- package.json | 2 +- templates/default/publish.js | 34 +++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 2257aeb5..69d41b1c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "JSDoc", "version": "3.0.0alpha", - "revision": "1319671194463", + "revision": "1323214202201", "description": "An automatic documentation generator for javascript.", "keywords": [ "documentation", "javascript" ], "licenses": [ diff --git a/templates/default/publish.js b/templates/default/publish.js index e5f98a88..d2a5bcd4 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -96,7 +96,13 @@ types = f.type.names; } - f.signature = (f.signature || '') + ''+htmlsafe(types.length? ' :'+types.join('|') : '')+''; + if (types && types.length) { + types = _.map(types, function(t) { + return linkto(t, htmlsafe(t)); + }); + } + + f.signature = (f.signature || '') + ''+(types.length? ' :'+types.join('|') : '')+''; } function addAttribs(f) { @@ -134,18 +140,8 @@ //} data.forEach(function(doclet) { - doclet.signature = ''; - doclet.attribs = ''; - - if (doclet.kind === 'member') { - addSignatureType(doclet); - addAttribs(doclet) - } - - if (doclet.kind === 'constant') { - addSignatureType(doclet); - addAttribs(doclet) - } + doclet.attribs = ''; + if (doclet.examples) { doclet.examples = doclet.examples.map(function(example) { @@ -226,6 +222,18 @@ // do this after the urls have all been generated data.forEach(function(doclet) { doclet.ancestors = generateAncestry(doclet); + + doclet.signature = ''; + + if (doclet.kind === 'member') { + addSignatureType(doclet); + addAttribs(doclet) + } + + if (doclet.kind === 'constant') { + addSignatureType(doclet); + addAttribs(doclet) + } }); var nav = '',