Empty fuzzy-finder list on cancel

This commit is contained in:
Corey Johnson & Kevin Sawicki
2012-12-12 15:08:20 -08:00
parent 81eed5e410
commit 0c68295ec6
3 changed files with 9 additions and 17 deletions

View File

@@ -48,7 +48,6 @@ class SelectList extends View
@error.text("").hide()
@removeClass("error")
else
@list.empty()
@error.text(message).show()
@addClass("error")
@@ -56,7 +55,6 @@ class SelectList extends View
if not message or message.length == ""
@loading.text("").hide()
else
@list.empty()
@setError()
@loading.text(message).show()
@@ -115,6 +113,7 @@ class SelectList extends View
@confirmed(element) if element?
cancel: ->
@list.empty()
@cancelling = true
@cancelled()
@detach()

View File

@@ -51,10 +51,12 @@ class FuzzyFinder extends SelectList
@attach() if @paths?.length
populateProjectPaths: ->
return if @array?.length > 0
@setLoading("Indexing...")
@rootView.project.getFilePaths().done (paths) =>
@setArray(paths)
if @array?.length > 0
@setArray(@array)
else
@setLoading("Indexing...")
@rootView.project.getFilePaths().done (paths) =>
@setArray(paths)
populateOpenBufferPaths: ->
@paths = @rootView.getOpenBufferPaths().map (path) =>