Fixed unbinding keyboard shortcuts

This commit is contained in:
Marcin Kurczewski 2014-10-18 12:42:29 +02:00
parent dd1dfcb9e8
commit 9c29f6173d

View file

@ -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);
}