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.
This commit is contained in:
Nathan Sobo
2012-03-16 05:58:12 -06:00
parent 5d1bde62a6
commit da75f8a6ff

View File

@@ -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)