mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
parent
9c877c7f0b
commit
5541875965
@ -171,6 +171,7 @@ describe "the `atom` global", ->
|
||||
|
||||
atom.activatePackage("package-with-menus")
|
||||
|
||||
expect(atom.menu.template.length).toBe 2
|
||||
expect(atom.menu.template[0].label).toBe "Second to Last"
|
||||
expect(atom.menu.template[1].label).toBe "Last"
|
||||
expect(atom.contextMenu.definitionsForElement(element)[0].label).toBe "Menu item 1"
|
||||
|
@ -1,3 +1,7 @@
|
||||
'menu': [
|
||||
{ 'label': 'Second to Last' }
|
||||
]
|
||||
|
||||
'context-menu':
|
||||
'.test-1':
|
||||
'Menu item 3': 'command-3'
|
||||
|
@ -111,7 +111,6 @@ afterEach ->
|
||||
keymap.bindingSets = bindingSetsToRestore
|
||||
keymap.bindingSetsByFirstKeystroke = bindingSetsByFirstKeystrokeToRestore
|
||||
atom.deactivatePackages()
|
||||
atom.menu.template = []
|
||||
|
||||
window.rootView?.remove?()
|
||||
atom.rootView?.remove?() if atom.rootView isnt window.rootView
|
||||
|
@ -43,10 +43,11 @@ class MenuManager
|
||||
# appended to the bottom of existing menus where possible.
|
||||
merge: (menu, item) ->
|
||||
item = _.deepClone(item)
|
||||
if item.submenu? and match = _.find(menu, (o) -> o.submenu? and o.label == item.label)
|
||||
|
||||
if item.submenu? and match = _.find(menu, (i) -> i.submenu? and i.label == item.label)
|
||||
@merge(match.submenu, i) for i in item.submenu
|
||||
else
|
||||
menu.push(item)
|
||||
menu.push(item) unless _.find(menu, (i) -> i.label == item.label)
|
||||
|
||||
# Private
|
||||
sendToBrowserProcess: (template, keystrokesByCommand) ->
|
||||
|
Loading…
Reference in New Issue
Block a user