diff --git a/4chan_x.user.js b/4chan_x.user.js index 9a8cde8b1..87377ccf5 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -730,7 +730,9 @@ if (((_ref = e.target.nodeName) === 'TEXTAREA' || _ref === 'INPUT') && !e.altKey && !e.ctrlKey && !(e.keyCode === 27)) { return; } - key = keybinds.cb.keyCode(e); + if (!(key = keybinds.cb.keyCode(e))) { + return; + } thread = nav.getThread(); switch (key) { case conf.close: @@ -1126,7 +1128,9 @@ keybind: function(e) { e.preventDefault(); e.stopPropagation(); - key = keybinds.cb.keyCode(e); + if (!(key = keybinds.cb.keyCode(e))) { + return; + } this.value = key; $.setValue(this.name, key); return conf[this.name] = key; diff --git a/script.coffee b/script.coffee index d5b6edfd5..60782e9c9 100644 --- a/script.coffee +++ b/script.coffee @@ -520,7 +520,7 @@ keybinds = cb: keydown: (e) -> return if e.target.nodeName in ['TEXTAREA', 'INPUT'] and not e.altKey and not e.ctrlKey and not (e.keyCode is 27) - key = keybinds.cb.keyCode e + return unless key = keybinds.cb.keyCode e thread = nav.getThread() switch key @@ -891,7 +891,7 @@ options = keybind: (e) -> e.preventDefault() e.stopPropagation() - key = keybinds.cb.keyCode e + return unless key = keybinds.cb.keyCode e @value = key $.setValue @name, key conf[@name] = key