Commit 8e340695 authored by Robert Griesemer's avatar Robert Griesemer

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
parent bb7eb400
...@@ -28,6 +28,10 @@ function godocs_onload() { ...@@ -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 = "";
......
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