Add KeymapManager::onDidLoadBundledKeymaps

This commit is contained in:
Ben Ogle
2014-09-10 17:28:47 -07:00
parent 7625e5352d
commit 70e1d14f96
3 changed files with 7 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ class ContextMenuManager
@commandOptions = x: e.pageX, y: e.pageY
]
atom.keymaps.on 'bundled-keymaps-loaded', => @loadPlatformItems()
atom.keymaps.onDidLoadBundledKeymaps => @loadPlatformItems()
loadPlatformItems: ->
menusDirPath = path.join(@resourcePath, 'menus')

View File

@@ -4,9 +4,13 @@ KeymapManager = require 'atom-keymap'
CSON = require 'season'
{jQuery} = require 'space-pen'
KeymapManager::onDidLoadBundledKeymaps = (callback) ->
@emitter.on 'did-load-bundled-keymaps', callback
KeymapManager::loadBundledKeymaps = ->
@loadKeymap(path.join(@resourcePath, 'keymaps'))
@emit('bundled-keymaps-loaded')
@emit 'bundled-keymaps-loaded'
@emitter.emit 'did-load-bundled-keymaps'
KeymapManager::getUserKeymapPath = ->
if userKeymapPath = CSON.resolve(path.join(@configDirPath, 'keymap'))

View File

@@ -14,7 +14,7 @@ class MenuManager
constructor: ({@resourcePath}) ->
@pendingUpdateOperation = null
@template = []
atom.keymaps.on 'bundled-keymaps-loaded', => @loadPlatformItems()
atom.keymaps.onDidLoadBundledKeymaps => @loadPlatformItems()
atom.packages.onDidActivateAll => @sortPackagesMenu()
# Public: Adds the given items to the application menu.