bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9051e6d882b341a29dc37eb95fcf237ab0b9161e
parent 5b639ebb8276aadcdc36dd3d5d650c7cdc35d54c
Author: Milo Turner <iitalics@gmail.com>
Date:   Tue, 29 Aug 2017 13:59:24 -0400

pressing "S" on the page body focuses to the search box

Diffstat:
Mscribble-lib/scribble/scribble-common.js | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/scribble-lib/scribble/scribble-common.js b/scribble-lib/scribble/scribble-common.js @@ -168,3 +168,13 @@ AddOnLoad(function(){ indicator.innerHTML = label; indicator.style.display = "block"; }); + +// Pressing "S" focuses on the "...search manuals..." text field +AddOnLoad(function(){ + window.addEventListener("keypress", function(event) { + if (event && event.charCode == 115 && event.target == document.body) { + var field = document.getElementsByClassName("searchbox")[0]; + field.focus(); + } + }, false); +});