mirror of
https://github.com/atom/atom.git
synced 2026-02-10 14:45:11 -05:00
Root view sets project's path using project.setPath(path)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user