소스 검색

Hide the shortcuts panel when the Escape key is pressed.

master
Boris Grozev 8 년 전
부모
커밋
2cefea3677
2개의 변경된 파일25개의 추가작업 그리고 8개의 파일을 삭제
  1. 12
    1
      modules/UI/UI.js
  2. 13
    7
      modules/keyboardshortcut/keyboardshortcut.js

+ 12
- 1
modules/UI/UI.js 파일 보기

@@ -1398,10 +1398,21 @@ UI.hideRingOverLay = function () {
1398 1398
 };
1399 1399
 
1400 1400
 /**
1401
- * Shows or hides the keyboard shortcuts panel.'
1401
+ * Shows or hides the keyboard shortcuts panel, depending on the current state.'
1402 1402
  */
1403 1403
 UI.toggleKeyboardShortcutsPanel = function() {
1404 1404
     $('#keyboard-shortcuts').toggle();
1405 1405
 };
1406 1406
 
1407
+/**
1408
+ * Shows or hides the keyboard shortcuts panel.'
1409
+ */
1410
+UI.showKeyboardShortcutsPanel = function(show) {
1411
+    if (show) {
1412
+        $('#keyboard-shortcuts').show();
1413
+    } else {
1414
+        $('#keyboard-shortcuts').hide();
1415
+    }
1416
+};
1417
+
1407 1418
 module.exports = UI;

+ 13
- 7
modules/keyboardshortcut/keyboardshortcut.js 파일 보기

@@ -3,13 +3,10 @@
3 3
 var shortcuts = {};
4 4
 function initShortcutHandlers() {
5 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 12
         67: {
@@ -52,6 +49,15 @@ function initShortcutHandlers() {
52 49
             function: function() {
53 50
                 APP.conference.toggleVideoMuted();
54 51
             }
52
+        },
53
+        191: {
54
+            character: "/",
55
+            function: function(e) {
56
+                // Only trigger on "?", not on "/".
57
+                if (e.shiftKey) {
58
+                    APP.UI.toggleKeyboardShortcutsPanel();
59
+                }
60
+            }
55 61
         }
56 62
     };
57 63
 }

Loading…
취소
저장