From da75f8a6ff421b17b0c665d3f14321adea25130b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 16 Mar 2012 05:58:12 -0600 Subject: [PATCH] Explicitly focus editor when file finder is closed. Trying to catch focusout events on anything other than the editor was really error-prone and ultimately more abstraction than we need right now. This fixes a bug where we would lose the ability to input text after clicking on the editor element. --- src/atom/root-view.coffee | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/atom/root-view.coffee b/src/atom/root-view.coffee index 3ad246718..9a2cd9ae5 100644 --- a/src/atom/root-view.coffee +++ b/src/atom/root-view.coffee @@ -28,11 +28,6 @@ class RootView extends View @on 'toggle-file-finder', => @toggleFileFinder() @on 'show-console', -> window.showConsole() - @on 'focusout', (e) => - # if anything but the main editor's hidden input loses focus, restore focus to the main editor - unless @editor.containsElement($(e.target)) - @editor.focus() - createProject: (url) -> if url @project = new Project(fs.directory(url)) @@ -47,6 +42,7 @@ class RootView extends View if @fileFinder and @fileFinder.parent()[0] @fileFinder.remove() @fileFinder = null + @editor.focus() else @project.getFilePaths().done (paths) => relativePaths = (path.replace(@project.url, "") for path in paths)