1
Fork 0

rustdoc: Get [src] links working for inlined dox

These links work by hyperlinking back to the actual documentation page with a
query parameter which will be recognized and then auto-click the appropriate
[src] link.
This commit is contained in:
Alex Crichton 2014-05-23 20:17:27 -07:00
parent 9f13db2cb2
commit 8dad7f579e
3 changed files with 96 additions and 32 deletions

View file

@ -675,4 +675,14 @@
if (window.pending_implementors) {
window.register_implementors(window.pending_implementors);
}
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (pair[0] == 'gotosrc') {
window.location = $('#src-' + pair[1]).attr('href');
}
}
}());