Issue 241: Add an 'addHref' Node option
Status:  Fixed
Owner: ----
Closed:  Dec 2011
Reported by vitorbal@gmail.com, Oct 24, 2011
Add an 'addHref' option to Node that inserts an href into the node html when loading the tree from JSON. Here is a code snippet example that would achieve this:

223     } else {
224 +     var href = data.addHref;
225 +     if (href && href[0] !== '/') {
226 +       href = '/' + href;
227 +     }
228 +     href = data.addHref ? window.location.protocol + '//' +
229 +       window.location.host + href : '#';
230 M     nodeTitle = "<a href='" + href + "' class='" +
231 M       opts.classNames.title + "'" + tooltip + ">" + data.title + "</a>";
232     }

What goal would this enhancement help you achieve?

This would allow the user to follow node links if he right clicks node > 'open in new tab', for example.
This also makes it so the node link is shown on the browser's status bar on hover, which is nice for usability purposes.
Oct 25, 2011
Project Member #1 moo...@wwwendt.de
Nice idea.
Why do you think it is important to prepend protocol and host (and port)? I would think that relative hrefs would work as well.
Labels: Milestone-Release1.2.1
Oct 31, 2011
#2 vitorbal@gmail.com
You're right, using just the relative hrefs work as well. I'm not quite sure why I did it prepending the stuff...
Anyway, glad you liked the idea :)
Dec 28, 2011
Project Member #3 moo...@wwwendt.de
This issue was closed by revision r556.
Status: Fixed