mirror of
https://github.com/atom/atom.git
synced 2026-01-21 04:48:12 -05:00
Clear context menus between specs
This commit is contained in:
@@ -125,6 +125,7 @@ beforeEach ->
|
||||
afterEach ->
|
||||
atom.packages.deactivatePackages()
|
||||
atom.menu.template = []
|
||||
atom.contextMenu.clear()
|
||||
|
||||
atom.workspaceView?.remove?()
|
||||
atom.workspaceView = null
|
||||
|
||||
@@ -20,18 +20,8 @@ SequenceCount = 0
|
||||
module.exports =
|
||||
class ContextMenuManager
|
||||
constructor: ({@resourcePath, @devMode}) ->
|
||||
@activeElement = null
|
||||
@itemSets = []
|
||||
@definitions = {'.overlayer': []} # TODO: Remove once color picker package stops touching private data
|
||||
|
||||
@add '.workspace': [{
|
||||
label: 'Inspect Element'
|
||||
command: 'application:inspect'
|
||||
devMode: true
|
||||
created: (event) ->
|
||||
{pageX, pageY} = event
|
||||
@commandOptions = {x: pageX, y: pageY}
|
||||
}]
|
||||
@clear()
|
||||
|
||||
atom.keymaps.onDidLoadBundledKeymaps => @loadPlatformItems()
|
||||
|
||||
@@ -163,6 +153,18 @@ class ContextMenuManager
|
||||
remote.getCurrentWindow().emit('context-menu', menuTemplate)
|
||||
return
|
||||
|
||||
clear: ->
|
||||
@activeElement = null
|
||||
@itemSets = []
|
||||
@add '.workspace': [{
|
||||
label: 'Inspect Element'
|
||||
command: 'application:inspect'
|
||||
devMode: true
|
||||
created: (event) ->
|
||||
{pageX, pageY} = event
|
||||
@commandOptions = {x: pageX, y: pageY}
|
||||
}]
|
||||
|
||||
class ContextMenuItemSet
|
||||
constructor: (@selector, @items) ->
|
||||
@specificity = (SpecificityCache[@selector] ?= specificity(@selector))
|
||||
|
||||
Reference in New Issue
Block a user