summaryrefslogtreecommitdiff
path: root/doc/godocs.js
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
commitc1ba1a0fec4aed430709030f98a3bdb90bfeea16 (patch)
tree3df18657e50a0313ed6defcda30e4474cb28a467 /doc/godocs.js
parent7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (diff)
downloadgolang-c1ba1a0fec4aed430709030f98a3bdb90bfeea16.tar.gz
Imported Upstream version 2011.04.27upstream/2011.04.27
Diffstat (limited to 'doc/godocs.js')
-rw-r--r--doc/godocs.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/godocs.js b/doc/godocs.js
index 8b451547d..2b3ab065f 100644
--- a/doc/godocs.js
+++ b/doc/godocs.js
@@ -34,7 +34,18 @@ function godocs_bindSearchEvents() {
search.className = "";
}
}
+ function restoreInactive() {
+ if (search.value != "") {
+ return;
+ }
+ if (search.type != "search") {
+ search.value = search.getAttribute("placeholder");
+ }
+ search.className = "inactive";
+ }
+ restoreInactive();
bindEvent(search, 'focus', clearInactive);
+ bindEvent(search, 'blur', restoreInactive);
}
/* Generates a table of contents: looks for h2 and h3 elements and generates