mirror of
https://github.com/golang/go
synced 2024-11-21 15:14:43 -07:00
godoc: if there is no search box, don't run the respective JS code
Fixes a JS crash which prevented the automatically generated table of contents to not appear. R=adg, bradfitz CC=golang-dev https://golang.org/cl/4460041
This commit is contained in:
parent
bb7eb4002e
commit
8e340695c1
@ -28,6 +28,10 @@ function godocs_onload() {
|
|||||||
|
|
||||||
function godocs_bindSearchEvents() {
|
function godocs_bindSearchEvents() {
|
||||||
var search = document.getElementById('search');
|
var search = document.getElementById('search');
|
||||||
|
if (!search) {
|
||||||
|
// no search box (index disabled)
|
||||||
|
return;
|
||||||
|
}
|
||||||
function clearInactive() {
|
function clearInactive() {
|
||||||
if (search.className == "inactive") {
|
if (search.className == "inactive") {
|
||||||
search.value = "";
|
search.value = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user