commit | 983e877dba55963e63ebabb4af4a2e5b8d7a2f03 | [log] [tgz] |
---|---|---|
author | Han-Wen Nienhuys <hanwen@google.com> | Fri Jan 31 11:24:28 2020 +0100 |
committer | Han-Wen Nienhuys <hanwen@google.com> | Mon Apr 06 17:00:53 2020 +0000 |
tree | 286af2d4a45ff8fe92f424175e866b83e42ca8b0 | |
parent | 77beb0fe608a1bd5f8561bfa16031868cedfe23d [diff] |
web: focus on searchbox for '/' keypress Change-Id: Idd9b88bac4371438e289bce8d6072e61381db9d0
diff --git a/web/templates.go b/web/templates.go index 310101f..7d07daa 100644 --- a/web/templates.go +++ b/web/templates.go
@@ -135,6 +135,15 @@ </div> </div> </nav> +<script> +document.onkeydown=function(e){ + var e = e || window.event; + if (e.key == "/") { + document.getElementById("navsearchbox").focus(); + return false; + } +}; +</script> `, // search box for the entry page. "search": `