Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Makes the keyboard shortcut class more readable.

fo60ef0f033bc4
diff --git a/keyboard_shortcut.js b/keyboard_shortcut.js
index aac145c8f4..3b5af016cb 100644
--- a/keyboard_shortcut.js
+++ b/keyboard_shortcut.js
@@ -1,4 +1,5 @@
var KeyboardShortcut = (function(my) {
+ //maps keycode to character, id of popover for given function and function
var shortcuts = {
67: {
character: "C",
@@ -35,9 +36,9 @@ var KeyboardShortcut = (function(my) {
var keycode = e.which;
if (typeof shortcuts[keycode] === "object") {
shortcuts[keycode].function();
- } else if (keycode >= 49 && keycode <= 57) {
+ } else if (keycode >= "1".charCodeAt(0) && keycode <= "9".charCodeAt(0)) {
var remoteVideos = $(".videocontainer:not(#mixedstream)"),
- videoWanted = keycode - 48;
+ videoWanted = keycode - "0".charCodeAt(0);
if (remoteVideos.length > videoWanted) {
remoteVideos[videoWanted].click();
}
@@ -47,13 +48,14 @@ var KeyboardShortcut = (function(my) {
window.onkeydown = function(e) {
if($("#chatspace").css("display") === "none") {
- if(e.which === 84) {
+ if(e.which === "T".charCodeAt(0)) {
if(isAudioMuted()) {
toggleAudio();
}
}
}
};
+
/**
*
* @param id indicates the popover associated with the shortcut