mirror of https://github.com/golang/go.git
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
This commit is contained in:
parent
b72325fde4
commit
13d6f8f7f3
|
|
@ -179,6 +179,13 @@ function fixFocus() {
|
|||
}).resize();
|
||||
}
|
||||
|
||||
function toggleHash() {
|
||||
var hash = $(window.location.hash);
|
||||
if (hash.is('.toggle')) {
|
||||
hash.addClass('toggleVisible').removeClass('toggle');
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
bindSearchEvents();
|
||||
generateTOC();
|
||||
|
|
@ -190,6 +197,7 @@ $(document).ready(function() {
|
|||
bindToggleLinks(".indexLink", "");
|
||||
setupDropdownPlayground();
|
||||
fixFocus();
|
||||
toggleHash();
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in New Issue