mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Move jQuery.Event::abortKeyBinding to keymap-extensions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user