Rename hotkeys array
This commit is contained in:
parent
c13840e029
commit
71b3acb152
@ -51,7 +51,7 @@ const upload = require("../js/upload");
|
|||||||
const Mousetrap = require("mousetrap");
|
const Mousetrap = require("mousetrap");
|
||||||
const {wrapCursor} = require("undate");
|
const {wrapCursor} = require("undate");
|
||||||
|
|
||||||
const colorsHotkeys = {
|
const formattingHotkeys = {
|
||||||
k: "\x03",
|
k: "\x03",
|
||||||
b: "\x02",
|
b: "\x02",
|
||||||
u: "\x1F",
|
u: "\x1F",
|
||||||
@ -94,10 +94,10 @@ export default {
|
|||||||
|
|
||||||
const inputTrap = Mousetrap(this.$refs.input);
|
const inputTrap = Mousetrap(this.$refs.input);
|
||||||
|
|
||||||
for (const hotkey in colorsHotkeys) {
|
for (const hotkey in formattingHotkeys) {
|
||||||
inputTrap.bind("mod+" + hotkey, function(e) {
|
inputTrap.bind("mod+" + hotkey, function(e) {
|
||||||
// Key is lowercased because keybinds also get processed if caps lock is on
|
// 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(
|
wrapCursor(
|
||||||
e.target,
|
e.target,
|
||||||
@ -211,7 +211,7 @@ export default {
|
|||||||
const args = text.substr(1).split(" ");
|
const args = text.substr(1).split(" ");
|
||||||
const cmd = args.shift().toLowerCase();
|
const cmd = args.shift().toLowerCase();
|
||||||
|
|
||||||
if (commands[cmd] && commands[cmd].input(args)) {
|
if (commands.hasOwnProperty(cmd) && commands[cmd].input(args)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user