Merge pull request #127 from fouksf/keyboard-shortcuts

Makes keyboard shortcuts active when chat is opened but not focused.
This commit is contained in:
bgrozev 2014-09-10 18:25:54 +03:00
commit 312b7db6a0
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ var KeyboardShortcut = (function(my) {
};
window.onkeyup = function(e) {
if($("#chatspace").css("display") === "none") {
if($("#chatspace").css("display") === "none" ||
!($("#usermsg").is(":focus") || $("#nickinput").is(":focus"))) {
var keycode = e.which;
if (typeof shortcuts[keycode] === "object") {
shortcuts[keycode].function();