Root view sets project's path using project.setPath(path)

This commit is contained in:
Corey Johnson
2012-05-01 10:00:53 -07:00
parent ee51a72721
commit d04be05e95
4 changed files with 17 additions and 6 deletions

View File

@@ -18,9 +18,14 @@ class Project
@path
setPath: (path) ->
@path = if fs.isDirectory(path) then path else fs.directory(path)
@rootDirectory.off() if @rootDirectory
@rootDirectory = new Directory(@path)
if path?
@path = if fs.isDirectory(path) then path else fs.directory(path)
@rootDirectory = new Directory(@path)
else
@path = null
@rootDirectory = null
getRootDirectory: ->
@rootDirectory

View File

@@ -32,7 +32,7 @@ class RootView extends View
@activeEditor().focus()
false
else
@setTitle(@project?.path)
@setTitle(@project?.getPath())
@on 'active-editor-path-change', (e, path) =>
@project.setPath(path) unless @project.getPath()
@@ -112,7 +112,7 @@ class RootView extends View
rootPane?.adjustDimensions()
toggleFileFinder: ->
return unless @project.path?
return unless @project.getPath()?
if @fileFinder and @fileFinder.parent()[0]
@fileFinder.remove()