Show number of paths loaded after indexing message

This commit is contained in:
Kevin Sawicki
2013-05-07 08:56:06 -07:00
parent 96418f3640
commit c3759feaa0
7 changed files with 20 additions and 30 deletions

View File

@@ -148,7 +148,8 @@ class FuzzyFinderView extends SelectList
@setArray(listedItems)
options.done(listedItems) if options.done?
else
@setLoading("Indexing...")
@setLoading("Indexing project...")
@loadingBadge.text("")
if @reloadProjectPaths
@loadPathsTask?.abort()
@@ -157,6 +158,8 @@ class FuzzyFinderView extends SelectList
@reloadProjectPaths = false
@populateProjectPaths(options)
@loadPathsTask = new LoadPathsTask(callback)
@loadPathsTask.on 'paths-loaded', (paths) =>
@loadingBadge.text(paths.length)
@loadPathsTask.start()
populateOpenBufferPaths: ->

View File

@@ -14,6 +14,7 @@ class LoadPathsTask extends Task
pathsLoaded: (paths) ->
@paths.push(paths...)
@trigger 'paths-loaded', @paths
pathLoadingComplete: ->
@callback(@paths)

View File

@@ -46,7 +46,7 @@ describe 'FuzzyFinder', ->
rootView.trigger 'fuzzy-finder:toggle-file-finder'
paths = null
expect(finderView.find(".loading")).toBeVisible()
expect(finderView.find(".loading")).toHaveText "Indexing..."
expect(finderView.find(".loading").text().length).toBeGreaterThan 0
waitsFor "all project paths to load", 5000, ->
unless finderView.reloadProjectPaths