From c1ba1a0fec4aed430709030f98a3bdb90bfeea16 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Thu, 28 Apr 2011 10:35:15 +0200 Subject: Imported Upstream version 2011.04.27 --- doc/godocs.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/godocs.js') 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 -- cgit v1.2.3