Pārlūkot izejas kodu

Merge pull request #127 from fouksf/keyboard-shortcuts

Makes keyboard shortcuts active when chat is opened but not focused.
j8
bgrozev 11 gadus atpakaļ
vecāks
revīzija
312b7db6a0
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2
    1
      keyboard_shortcut.js

+ 2
- 1
keyboard_shortcut.js Parādīt failu

32
     };
32
     };
33
 
33
 
34
     window.onkeyup = function(e) {
34
     window.onkeyup = function(e) {
35
-        if($("#chatspace").css("display") === "none") {
35
+        if($("#chatspace").css("display") === "none" ||
36
+            !($("#usermsg").is(":focus") || $("#nickinput").is(":focus"))) {
36
             var keycode = e.which;
37
             var keycode = e.which;
37
             if (typeof shortcuts[keycode] === "object") {
38
             if (typeof shortcuts[keycode] === "object") {
38
                 shortcuts[keycode].function();
39
                 shortcuts[keycode].function();

Notiek ielāde…
Atcelt
Saglabāt