ソースを参照

Merge pull request #705 from bgrozev/esc-shortcut

Hide the shortcuts panel when the Escape key is pressed.
j8
Дамян Минков 9年前
コミット
f3dc6f15e4
2個のファイルの変更25行の追加8行の削除
  1. 12
    1
      modules/UI/UI.js
  2. 13
    7
      modules/keyboardshortcut/keyboardshortcut.js

+ 12
- 1
modules/UI/UI.js ファイルの表示

1416
 };
1416
 };
1417
 
1417
 
1418
 /**
1418
 /**
1419
- * Shows or hides the keyboard shortcuts panel.'
1419
+ * Shows or hides the keyboard shortcuts panel, depending on the current state.'
1420
  */
1420
  */
1421
 UI.toggleKeyboardShortcutsPanel = function() {
1421
 UI.toggleKeyboardShortcutsPanel = function() {
1422
     $('#keyboard-shortcuts').toggle();
1422
     $('#keyboard-shortcuts').toggle();
1423
 };
1423
 };
1424
 
1424
 
1425
+/**
1426
+ * Shows or hides the keyboard shortcuts panel.'
1427
+ */
1428
+UI.showKeyboardShortcutsPanel = function(show) {
1429
+    if (show) {
1430
+        $('#keyboard-shortcuts').show();
1431
+    } else {
1432
+        $('#keyboard-shortcuts').hide();
1433
+    }
1434
+};
1435
+
1425
 module.exports = UI;
1436
 module.exports = UI;

+ 13
- 7
modules/keyboardshortcut/keyboardshortcut.js ファイルの表示

3
 var shortcuts = {};
3
 var shortcuts = {};
4
 function initShortcutHandlers() {
4
 function initShortcutHandlers() {
5
     shortcuts = {
5
     shortcuts = {
6
-        191: {
7
-            character: "/",
8
-            function: function(e) {
9
-                // Only trigger on "?", not on "/".
10
-                if (e.shiftKey) {
11
-                    APP.UI.toggleKeyboardShortcutsPanel();
12
-                }
6
+        27: {
7
+            character: "Esc",
8
+            function: function() {
9
+                APP.UI.showKeyboardShortcutsPanel(false);
13
             }
10
             }
14
         },
11
         },
15
         67: {
12
         67: {
59
             function: function() {
56
             function: function() {
60
                 APP.conference.toggleVideoMuted();
57
                 APP.conference.toggleVideoMuted();
61
             }
58
             }
59
+        },
60
+        191: {
61
+            character: "/",
62
+            function: function(e) {
63
+                // Only trigger on "?", not on "/".
64
+                if (e.shiftKey) {
65
+                    APP.UI.toggleKeyboardShortcutsPanel();
66
+                }
67
+            }
62
         }
68
         }
63
     };
69
     };
64
 }
70
 }

読み込み中…
キャンセル
保存