mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user