From 9c29f6173d8a1056ff4a9678bc85806a6d2a0f60 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 18 Oct 2014 12:42:29 +0200 Subject: [PATCH] Fixed unbinding keyboard shortcuts --- public_html/js/Keyboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public_html/js/Keyboard.js b/public_html/js/Keyboard.js index 2261ce87..d981185a 100644 --- a/public_html/js/Keyboard.js +++ b/public_html/js/Keyboard.js @@ -3,10 +3,12 @@ var App = App || {}; App.Keyboard = function(mousetrap) { function keyup(key, callback) { + unbind(key); mousetrap.bind(key, simpleKeyPressed(callback), 'keyup'); } function keydown(key, callback) { + unbind(key); mousetrap.bind(key, simpleKeyPressed(callback)); } @@ -23,6 +25,7 @@ App.Keyboard = function(mousetrap) { } function unbind(key) { + mousetrap.unbind(key, 'keyup'); mousetrap.unbind(key); }