| Issue 241: | Add an 'addHref' Node option | |
| 1 person starred this issue and may be notified of changes. | Back to list |
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
Labels:
Milestone-Release1.2.1
Oct 31, 2011
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 :) |