Command panel can be detached after preview without throwing an exception

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-07-18 15:19:55 -06:00
parent b959d5aa37
commit 12a576ff95
2 changed files with 3 additions and 0 deletions

View File

@@ -138,6 +138,8 @@ describe "CommandPanel", ->
expect(previewItem.preview.text()).toBe "aaa bbb"
expect(previewItem.preview.find(".match").text()).toBe "aaa"
rootView.trigger 'command-panel:toggle'
describe "if the command is malformed", ->
it "adds and removes an error class to the command panel and does not close it", ->
rootView.trigger 'command-panel:toggle'

View File

@@ -68,6 +68,7 @@ class CommandPanel extends View
@rootView.focus()
if @previewedOperations
operation.destroy() for operation in @previewedOperations
@previewedOperations = undefined
super
execute: (command = @miniEditor.getText()) ->