From 71b3acb15225ca9fd11b82038c8a12d68332c47e Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 13 Oct 2018 13:11:38 +0300 Subject: [PATCH] Rename hotkeys array --- client/components/ChatInput.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/components/ChatInput.vue b/client/components/ChatInput.vue index 6c3af610..3bbb5ea9 100644 --- a/client/components/ChatInput.vue +++ b/client/components/ChatInput.vue @@ -51,7 +51,7 @@ const upload = require("../js/upload"); const Mousetrap = require("mousetrap"); const {wrapCursor} = require("undate"); -const colorsHotkeys = { +const formattingHotkeys = { k: "\x03", b: "\x02", u: "\x1F", @@ -94,10 +94,10 @@ export default { const inputTrap = Mousetrap(this.$refs.input); - for (const hotkey in colorsHotkeys) { + for (const hotkey in formattingHotkeys) { inputTrap.bind("mod+" + hotkey, function(e) { // Key is lowercased because keybinds also get processed if caps lock is on - const modifier = colorsHotkeys[e.key.toLowerCase()]; + const modifier = formattingHotkeys[e.key.toLowerCase()]; wrapCursor( e.target, @@ -211,7 +211,7 @@ export default { const args = text.substr(1).split(" "); const cmd = args.shift().toLowerCase(); - if (commands[cmd] && commands[cmd].input(args)) { + if (commands.hasOwnProperty(cmd) && commands[cmd].input(args)) { return false; } }