Pārlūkot izejas kodu

Removed separate check for SPACE

master
Maxim Voloshin 9 gadus atpakaļ
vecāks
revīzija
6e90b767ef
1 mainītis faili ar 5 papildinājumiem un 6 dzēšanām
  1. 5
    6
      modules/keyboardshortcut/keyboardshortcut.js

+ 5
- 6
modules/keyboardshortcut/keyboardshortcut.js Parādīt failu

@@ -17,10 +17,12 @@ function initGlobalShortcuts() {
17 17
         APP.UI.toggleKeyboardShortcutsPanel();
18 18
     }, "keyboardShortcuts.toggleShortcuts");
19 19
 
20
-    KeyboardShortcut.registerShortcut("SPACE", null, function() {
20
+    // register SPACE shortcut in two steps to insure visibility of help message
21
+    KeyboardShortcut.registerShortcut(" ", null, function() {
21 22
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
22 23
         APP.conference.muteAudio(true);
23
-    }, "keyboardShortcuts.pushToTalk");
24
+    });
25
+    KeyboardShortcut._addShortcutToHelp("SPACE","keyboardShortcuts.pushToTalk");
24 26
 
25 27
     /**
26 28
      * FIXME: Currently focus keys are directly implemented below in onkeyup.
@@ -68,7 +70,7 @@ var KeyboardShortcut = {
68 70
                 $(":focus").is("input[type=password]") ||
69 71
                 $(":focus").is("textarea"))) {
70 72
                 var key = self._getKeyboardKey(e).toUpperCase();
71
-                if(key === "SPACE") {
73
+                if(key === " ") {
72 74
                     if(APP.conference.isLocalAudioMuted())
73 75
                         APP.conference.muteAudio(false);
74 76
                 }
@@ -139,9 +141,6 @@ var KeyboardShortcut = {
139 141
      * @returns {string} e.key or something close if not supported
140 142
      */
141 143
     _getKeyboardKey: function (e) {
142
-        if (e.which === 32) {
143
-            return 'SPACE';
144
-        }
145 144
         if (typeof e.key === "string") {
146 145
             return e.key;
147 146
         }

Notiek ielāde…
Atcelt
Saglabāt