mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Updated mousetrap to newest version
This removes need for my fix in keyboard.js: ccampbell/mousetrap#53
This commit is contained in:
@ -4,20 +4,12 @@ App.Keyboard = function(mousetrap) {
|
||||
|
||||
function keyup(key, callback) {
|
||||
unbind(key);
|
||||
mousetrap.bind(key, simpleKeyPressed(callback), 'keyup');
|
||||
mousetrap.bind(key, callback, 'keyup');
|
||||
}
|
||||
|
||||
function keydown(key, callback) {
|
||||
unbind(key);
|
||||
mousetrap.bind(key, simpleKeyPressed(callback));
|
||||
}
|
||||
|
||||
function simpleKeyPressed(callback) {
|
||||
return function(e) {
|
||||
if (!e.altKey && !e.ctrlKey) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
mousetrap.bind(key, callback);
|
||||
}
|
||||
|
||||
function reset() {
|
||||
|
Reference in New Issue
Block a user