Merge pull request #705 from bgrozev/esc-shortcut
Hide the shortcuts panel when the Escape key is pressed.
This commit is contained in:
commit
f3dc6f15e4
|
@ -1416,10 +1416,21 @@ UI.hideRingOverLay = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows or hides the keyboard shortcuts panel.'
|
* Shows or hides the keyboard shortcuts panel, depending on the current state.'
|
||||||
*/
|
*/
|
||||||
UI.toggleKeyboardShortcutsPanel = function() {
|
UI.toggleKeyboardShortcutsPanel = function() {
|
||||||
$('#keyboard-shortcuts').toggle();
|
$('#keyboard-shortcuts').toggle();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows or hides the keyboard shortcuts panel.'
|
||||||
|
*/
|
||||||
|
UI.showKeyboardShortcutsPanel = function(show) {
|
||||||
|
if (show) {
|
||||||
|
$('#keyboard-shortcuts').show();
|
||||||
|
} else {
|
||||||
|
$('#keyboard-shortcuts').hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = UI;
|
module.exports = UI;
|
||||||
|
|
|
@ -3,13 +3,10 @@
|
||||||
var shortcuts = {};
|
var shortcuts = {};
|
||||||
function initShortcutHandlers() {
|
function initShortcutHandlers() {
|
||||||
shortcuts = {
|
shortcuts = {
|
||||||
191: {
|
27: {
|
||||||
character: "/",
|
character: "Esc",
|
||||||
function: function(e) {
|
function: function() {
|
||||||
// Only trigger on "?", not on "/".
|
APP.UI.showKeyboardShortcutsPanel(false);
|
||||||
if (e.shiftKey) {
|
|
||||||
APP.UI.toggleKeyboardShortcutsPanel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
67: {
|
67: {
|
||||||
|
@ -59,6 +56,15 @@ function initShortcutHandlers() {
|
||||||
function: function() {
|
function: function() {
|
||||||
APP.conference.toggleVideoMuted();
|
APP.conference.toggleVideoMuted();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
191: {
|
||||||
|
character: "/",
|
||||||
|
function: function(e) {
|
||||||
|
// Only trigger on "?", not on "/".
|
||||||
|
if (e.shiftKey) {
|
||||||
|
APP.UI.toggleKeyboardShortcutsPanel();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue