Call populateProjectPaths when callback completes

This removes duplicate code for the cases when a callback
is used and when the view already has populated paths.
This commit is contained in:
Kevin Sawicki
2013-03-20 11:59:36 -07:00
parent 2f190025a9
commit ae96a48572

View File

@@ -157,15 +157,7 @@ class FuzzyFinderView extends SelectList
callback = (paths) =>
@projectPaths = paths
@reloadProjectPaths = false
listedItems =
if options.filter?
@projectPaths.filter (path) ->
path.indexOf(options.filter) >= 0
else
@projectPaths
@setArray(listedItems)
options.done(listedItems) if options.done?
@populateProjectPaths(options)
@loadPathsTask = new LoadPathsTask(callback)
@loadPathsTask.start()