From b6334483c95103ba88726db59ae4f8eecdb9ff72 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 27 Mar 2013 15:41:26 -0400 Subject: [PATCH] Hide the loading message when eval throws an error --- src/packages/command-panel/lib/command-panel-view.coffee | 1 + src/packages/command-panel/spec/command-panel-spec.coffee | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/packages/command-panel/lib/command-panel-view.coffee b/src/packages/command-panel/lib/command-panel-view.coffee index 74806feda..a0255a6c0 100644 --- a/src/packages/command-panel/lib/command-panel-view.coffee +++ b/src/packages/command-panel/lib/command-panel-view.coffee @@ -141,6 +141,7 @@ class CommandPanelView extends View else @detach() catch error + @loadingMessage.hide() if error.name is "SyntaxError" @flashError() return diff --git a/src/packages/command-panel/spec/command-panel-spec.coffee b/src/packages/command-panel/spec/command-panel-spec.coffee index cf86ae0b4..782399da3 100644 --- a/src/packages/command-panel/spec/command-panel-spec.coffee +++ b/src/packages/command-panel/spec/command-panel-spec.coffee @@ -345,13 +345,15 @@ describe "CommandPanel", -> # there shouldn't be any dangling operations after this describe "if the command is malformed", -> - it "adds and removes an error class to the command panel and does not close it", -> + it "adds and removes an error class to the command panel and does not close it or display a loading message", -> + rootView.attachToDom() rootView.trigger 'command-panel:toggle' commandPanel.miniEditor.insertText 'garbage-command!!' commandPanel.miniEditor.hiddenInput.trigger keydownEvent('enter') expect(commandPanel.parent()).toExist() expect(commandPanel).toHaveClass 'error' + expect(commandPanel.loadingMessage).toBeHidden() advanceClock 400