mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
atomController.path => window.path
This commit is contained in:
@@ -13,7 +13,6 @@ class FilefinderPane extends Pane
|
||||
html: require "filefinder/filefinder.html"
|
||||
|
||||
constructor: (@filefinder) ->
|
||||
@path = atomController.path
|
||||
$('#filefinder input').live 'keydown', @onKeydown
|
||||
|
||||
css = File.read require.resolve 'filefinder/facebox.css'
|
||||
@@ -43,9 +42,9 @@ class FilefinderPane extends Pane
|
||||
@showFinder()
|
||||
@showing = not @showing
|
||||
|
||||
paths: ->
|
||||
paths: ->
|
||||
_paths = []
|
||||
for dir in File.list @path
|
||||
for dir in File.list window.path
|
||||
continue if /\.git|Cocoa/.test dir
|
||||
_paths.push File.listDirectoryTree dir
|
||||
_.reject _.flatten(_paths), (dir) -> File.isDirectory dir
|
||||
@@ -54,7 +53,7 @@ class FilefinderPane extends Pane
|
||||
$.facebox @html
|
||||
@files = []
|
||||
for file in @paths()
|
||||
@files.push file.replace "#{@path}/", ''
|
||||
@files.push file.replace "#{window.path}/", ''
|
||||
@filterFiles()
|
||||
|
||||
findMatchingFiles: (query) ->
|
||||
@@ -87,7 +86,7 @@ class FilefinderPane extends Pane
|
||||
$('#filefinder li:first').addClass 'selected'
|
||||
|
||||
openSelected: ->
|
||||
dir = @path
|
||||
dir = window.path
|
||||
file = $('#filefinder .selected').text()
|
||||
window.open "#{dir}/#{file}"
|
||||
@toggle()
|
||||
|
||||
@@ -47,8 +47,8 @@ class TreePane extends Pane
|
||||
true
|
||||
|
||||
reload: ->
|
||||
@html.children('#tree .cwd').text _.last atomController.path.split '/'
|
||||
fileList = @createList atomController.path
|
||||
@html.children('#tree .cwd').text _.last window.path.split '/'
|
||||
fileList = @createList window.path
|
||||
fileList.addClass 'files'
|
||||
@html.children('#tree .files').replaceWith fileList
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class Tree extends Extension
|
||||
KeyBinder.load require.resolve "tree/key-bindings.coffee"
|
||||
|
||||
# watch the root dir
|
||||
Watcher.watch atomController.path, @watchDir
|
||||
Watcher.watch window.path, @watchDir
|
||||
|
||||
# Hide dirs that no longer exist, watch dirs that do.
|
||||
for dir in @shownDirs()
|
||||
@@ -34,7 +34,7 @@ class Tree extends Extension
|
||||
@unwatchDir dir for dir in @shownDirs()
|
||||
|
||||
shownDirStorageKey: ->
|
||||
@.constructor.name + ":" + atomController.path + ":shownDirs"
|
||||
@.constructor.name + ":" + window.path + ":shownDirs"
|
||||
|
||||
watchDir: (dir) =>
|
||||
@pane.reload()
|
||||
|
||||
Reference in New Issue
Block a user