Merge branch 'master' of github.com:probablycorey/Atomicity

Conflicts:
	src/atom/project.coffee
This commit is contained in:
Nathan Sobo
2012-01-04 19:05:01 -08:00
7 changed files with 23 additions and 26 deletions

View File

@@ -14,7 +14,7 @@ class FileFinder extends Template
urls: null
maxResults: null
initialize: ({@urls}) ->
initialize: ({@urls, @selected}) ->
@maxResults = 10
@populateUrlList()
@@ -34,8 +34,8 @@ class FileFinder extends Template
select: ->
filePath = @findSelectedLi().text()
atom.open filePath if filePath
@selected(filePath) if filePath and @selected
@remove()
moveUp: ->
@findSelectedLi()

View File

@@ -6,7 +6,5 @@ class Project
constructor: (@url) ->
getFilePaths: ->
projectUrl = @url
fs.async.listFiles(@url, true).pipe (urls) ->
url.replace(projectUrl, "") for url in urls
fs.async.listFiles(@url, true)

View File

@@ -33,11 +33,11 @@ class RootView extends Template
toggleFileFinder: ->
return unless @project
if @fileFinder
if @fileFinder and @fileFinder.parent()[0]
@fileFinder.remove()
@fileFinder = null
else
@project.getFilePaths().done (urls) =>
@fileFinder = FileFinder.build({urls})
@fileFinder = FileFinder.build({urls, selected: (url) => @editor.open(url)})
@addPane(@fileFinder)
@fileFinder.input.focus()