Updated mousetrap to newest version

This removes need for my fix in keyboard.js: ccampbell/mousetrap#53
This commit is contained in:
Marcin Kurczewski 2014-10-18 15:21:38 +02:00
parent d18305d779
commit 3f93aaa652
3 changed files with 4 additions and 12 deletions

View file

@ -79,7 +79,7 @@ module.exports = function(grunt) {
files: [ files: [
{ src: 'node_modules/jquery/dist/jquery.min.js', dest: 'public_html/lib/jquery.min.js' }, { src: 'node_modules/jquery/dist/jquery.min.js', dest: 'public_html/lib/jquery.min.js' },
{ src: 'node_modules/jquery.cookie/jquery.cookie.js', dest: 'public_html/lib/jquery.cookie.js' }, { src: 'node_modules/jquery.cookie/jquery.cookie.js', dest: 'public_html/lib/jquery.cookie.js' },
{ src: 'node_modules/mousetrap/mousetrap.min.js', dest: 'public_html/lib/mousetrap.min.js' }, { src: 'node_modules/Mousetrap/mousetrap.min.js', dest: 'public_html/lib/mousetrap.min.js' },
{ src: 'node_modules/pathjs/path.js', dest: 'public_html/lib/path.js' }, { src: 'node_modules/pathjs/path.js', dest: 'public_html/lib/path.js' },
{ src: 'node_modules/underscore/underscore-min.js', dest: 'public_html/lib/underscore.min.js' }, { src: 'node_modules/underscore/underscore-min.js', dest: 'public_html/lib/underscore.min.js' },
{ src: 'node_modules/marked/lib/marked.js', dest: 'public_html/lib/marked.js' }, { src: 'node_modules/marked/lib/marked.js', dest: 'public_html/lib/marked.js' },

View file

@ -5,7 +5,7 @@
"jquery.cookie": "1.4.1", "jquery.cookie": "1.4.1",
"jquery": "~2.1.1", "jquery": "~2.1.1",
"underscore": "1.7.0", "underscore": "1.7.0",
"mousetrap": "0.0.1", "mousetrap": "git://github.com/ccampbell/mousetrap.git",
"marked": "~0.3.2", "marked": "~0.3.2",
"requirejs": "*", "requirejs": "*",

View file

@ -4,20 +4,12 @@ App.Keyboard = function(mousetrap) {
function keyup(key, callback) { function keyup(key, callback) {
unbind(key); unbind(key);
mousetrap.bind(key, simpleKeyPressed(callback), 'keyup'); mousetrap.bind(key, callback, 'keyup');
} }
function keydown(key, callback) { function keydown(key, callback) {
unbind(key); unbind(key);
mousetrap.bind(key, simpleKeyPressed(callback)); mousetrap.bind(key, callback);
}
function simpleKeyPressed(callback) {
return function(e) {
if (!e.altKey && !e.ctrlKey) {
callback();
}
};
} }
function reset() { function reset() {