diff --git a/app/mixins/shortcuts.js b/app/mixins/shortcuts.js index 8391f7fa60..6939939c69 100644 --- a/app/mixins/shortcuts.js +++ b/app/mixins/shortcuts.js @@ -45,33 +45,27 @@ key.setScope('default'); */ export default Mixin.create({ - _hasRegisteredShortcuts: false, - registerShortcuts() { - if (!this._hasRegisteredShortcuts) { - let shortcuts = this.get('shortcuts'); + let shortcuts = this.get('shortcuts'); - Object.keys(shortcuts).forEach((shortcut) => { - let scope = shortcuts[shortcut].scope || 'default'; - let action = shortcuts[shortcut]; - let options; + Object.keys(shortcuts).forEach((shortcut) => { + let scope = shortcuts[shortcut].scope || 'default'; + let action = shortcuts[shortcut]; + let options; - if (typeOf(action) !== 'string') { - options = action.options; - action = action.action; - } + if (typeOf(action) !== 'string') { + options = action.options; + action = action.action; + } - key(shortcut, scope, (event) => { - // stop things like ctrl+s from actually opening a save dialogue - event.preventDefault(); - run(this, function () { - this.send(action, options); - }); + key(shortcut, scope, (event) => { + // stop things like ctrl+s from actually opening a save dialogue + event.preventDefault(); + run(this, function () { + this.send(action, options); }); }); - - this._hasRegisteredShortcuts = true; - } + }); }, removeShortcuts() { diff --git a/package.json b/package.json index c08664cd6b..d9916fef43 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "google-caja-bower": "https://github.com/acburdine/google-caja-bower#ghost", "grunt": "1.0.2", "grunt-shell": "2.1.0", - "keymaster": "1.6.2", + "keymaster": "https://github.com/madrobby/keymaster.git", "liquid-fire": "0.29.2", "liquid-tether": "2.0.6", "liquid-wormhole": "2.1.1", diff --git a/yarn.lock b/yarn.lock index 4821715e79..cdcaf07a81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6493,9 +6493,9 @@ just-extend@^1.1.27: version "1.1.27" resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905" -keymaster@1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/keymaster/-/keymaster-1.6.2.tgz#e1ae54d0ea9488f9f60b66b668f02e9a1946c6eb" +"keymaster@https://github.com/madrobby/keymaster.git": + version "1.6.3" + resolved "https://github.com/madrobby/keymaster.git#3b1f2afabf1569848dea8b697ac418f19b601a30" kind-of@^1.1.0: version "1.1.0"