mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
FileFinder removes itself when item is selected.
This commit is contained in:
@@ -65,9 +65,11 @@ describe 'FileFinder', ->
|
||||
finder = FileFinder.build {urls, selected: selectedCallback}
|
||||
|
||||
it "when a file is selected Editor.open is called", ->
|
||||
spyOn(finder, 'remove')
|
||||
finder.moveDown()
|
||||
finder.select()
|
||||
expect(selectedCallback).toHaveBeenCalledWith(urls[1])
|
||||
expect(finder.remove).toHaveBeenCalled()
|
||||
|
||||
it "when no file is selected, does nothing", ->
|
||||
spyOn(atom, 'open')
|
||||
|
||||
@@ -35,6 +35,7 @@ class FileFinder extends Template
|
||||
select: ->
|
||||
filePath = @findSelectedLi().text()
|
||||
@selected(filePath) if filePath and @selected
|
||||
@remove()
|
||||
|
||||
moveUp: ->
|
||||
@findSelectedLi()
|
||||
|
||||
@@ -38,7 +38,7 @@ class RootView extends Template
|
||||
toggleFileFinder: ->
|
||||
return unless @project
|
||||
|
||||
if @fileFinder
|
||||
if @fileFinder and @fileFinder.parent()[0]
|
||||
@fileFinder.remove()
|
||||
@fileFinder = null
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user