From b3dee855644d220f0c0f7e35566d526d3113ac65 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 1 Nov 2014 09:51:48 -0600 Subject: [PATCH] Make keypresses focus the input field --- app/wirc.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/wirc.js b/app/wirc.js index 33dfc91..45d4706 100644 --- a/app/wirc.js +++ b/app/wirc.js @@ -75,6 +75,10 @@ function hideChannels(oEvent) { } } +function keyPress(oEvent) { + document.getElementById("input").focus(); +} + function restore(items) { storedConnections = items["connections"]; @@ -89,6 +93,7 @@ function init() { chrome.storage.sync.get(["connections"], restore); document.getElementById("input").addEventListener("change", handleInput); document.getElementById("hide-channels").addEventListener("click", hideChannels); + window.addEventListener("keypress", keyPress); templates = document.getElementById("templates"); rooms = document.getElementById("rooms-container").getElementsByClassName("rooms")[0];