mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
core:close events close Command Panel (but not the entire window)
This commit is contained in:
@@ -79,9 +79,16 @@ describe "CommandPanel", ->
|
||||
rootView2.deactivate()
|
||||
|
||||
describe "when core:close is triggered on the command panel", ->
|
||||
it "detaches the command panel", ->
|
||||
it "detaches the command panel, focuses the RootView and does not bubble the core:close event", ->
|
||||
commandPanel.attach()
|
||||
rootViewCloseHandler = jasmine.createSpy('rootViewCloseHandler')
|
||||
rootView.on 'core:close', rootViewCloseHandler
|
||||
spyOn(rootView, 'focus')
|
||||
|
||||
commandPanel.trigger('core:close')
|
||||
|
||||
expect(rootView.focus).toHaveBeenCalled()
|
||||
expect(rootViewCloseHandler).not.toHaveBeenCalled()
|
||||
expect(commandPanel.hasParent()).toBeFalsy()
|
||||
|
||||
describe "when command-panel:toggle is triggered on the root view", ->
|
||||
|
||||
@@ -51,7 +51,7 @@ class CommandPanel extends View
|
||||
@historyIndex = @history.length
|
||||
|
||||
@command 'tool-pane:unfocus', => @rootView.focus()
|
||||
@command 'core:close', => @detach()
|
||||
@command 'core:close', => @detach(); false
|
||||
@command 'core:confirm', => @execute()
|
||||
|
||||
@rootView.command 'command-panel:toggle', => @toggle()
|
||||
|
||||
Reference in New Issue
Block a user