jsdoc: when linking to a member of the same class, toggle it.

This commit is contained in:
Jonathan Puckey 2011-05-29 17:23:45 +02:00
parent 1bbf5e27bf
commit 044dd34e9f

View file

@ -164,8 +164,13 @@ Link.prototype._makeSymbolLink = function(alias, parameters) {
link.linkText = link.linkText.charAt(0).toLowerCase() + link.linkText.slice(1);
link.linkText = link.linkText.replace(/#/g, '.');
}
return "<a href=\""+link.linkPath+link.linkInner+"\""+target+">"+link.linkText+"</a>";
var onClick = '';
// If linking to a member of the same class, we also need to toggle it:
if (alias.charAt(0) == '#') {
var linkName = link.linkPath.replace(/^[^#]+#/, '');
onClick = " onclick=\"return toggleMember('" + linkName + "', true);\"";
}
return "<a href=\""+link.linkPath+link.linkInner+"\""+target+onClick+">"+link.linkText+"</a>";
}
/** Create a link to a source file. */