Skip to content

Commit

Permalink
Fix Chrome, and Safari scrolling + anchor in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zexbe authored and Joshua Nelson committed Feb 2, 2020
1 parent 93a59ab commit 9164b48
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion templates/rustdoc.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,25 @@
</head>
<body>
{{> navigation_rustdoc}}
<div class="{{content.rustdoc_body_class}}" tabindex="1">
<div id="rustdoc_body_wrapper" class="{{content.rustdoc_body_class}}" tabindex="-1">
{{{content.rustdoc_body}}}
</div>
<script type="text/javascript" src="/menu.js?{{cratesfyi_version_safe}}"></script>
</body>
<script>
var doc_body = document.getElementById("rustdoc_body_wrapper");
if(window.location.hash) {
var notFirefox = typeof InstallTrigger === 'undefined';
if(notFirefox) {
var hash = window.location.hash;
window.location.hash = "";
setTimeout(function () {
window.location.hash = hash;
doc_body.focus();
}, 1);
}
} else {
doc_body.focus();
}
</script>
</html>

0 comments on commit 9164b48

Please sign in to comment.