Commit 13d6f8f7 authored by Kamil Kisiel's avatar Kamil Kisiel Committed by Andrew Gerrand

godoc: enable visibility of element linked from URL hash

Expands the example when visiting a URL such as
http://golang.org/pkg/net/http/#example_Hijacker

Fixes #5212.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/8378043
parent b72325fd
...@@ -179,6 +179,13 @@ function fixFocus() { ...@@ -179,6 +179,13 @@ function fixFocus() {
}).resize(); }).resize();
} }
function toggleHash() {
var hash = $(window.location.hash);
if (hash.is('.toggle')) {
hash.addClass('toggleVisible').removeClass('toggle');
}
}
$(document).ready(function() { $(document).ready(function() {
bindSearchEvents(); bindSearchEvents();
generateTOC(); generateTOC();
...@@ -190,6 +197,7 @@ $(document).ready(function() { ...@@ -190,6 +197,7 @@ $(document).ready(function() {
bindToggleLinks(".indexLink", ""); bindToggleLinks(".indexLink", "");
setupDropdownPlayground(); setupDropdownPlayground();
fixFocus(); fixFocus();
toggleHash();
}); });
})(); })();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment