Move jQuery.Event::abortKeyBinding to keymap-extensions

This commit is contained in:
Nathan Sobo
2014-03-17 12:50:24 -06:00
parent dcdc9d6b90
commit ff23f62c3e
2 changed files with 6 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ fs = require 'fs-plus'
path = require 'path'
Keymap = require 'atom-keymap'
CSON = require 'season'
{jQuery} = require 'space-pen'
Keymap::loadBundledKeymaps = ->
@loadKeyBindings(path.join(@resourcePath, 'keymaps'))
@@ -18,4 +19,9 @@ Keymap::loadUserKeymap = ->
if fs.isFileSync(userKeymapPath)
@loadKeyBindings(userKeymapPath, watch: true, suppressErrors: true)
# This enables command handlers registered via jQuery to call
# `.abortKeyBinding()` on the `jQuery.Event` object passed to the handler.
jQuery.Event::abortKeyBinding = ->
@originalEvent?.abortKeyBinding?()
module.exports = Keymap

View File

@@ -69,7 +69,4 @@ jQuery(document.body).on 'show.bs.tooltip', ({target}) ->
jQuery.fn.setTooltip.getKeystroke = getKeystroke
jQuery.fn.setTooltip.humanizeKeystrokes = humanizeKeystrokes
jQuery.Event::abortKeyBinding = ->
@originalEvent?.abortKeyBinding?()
module.exports = spacePen