opening file/dir works again.

but I don't like it. I feel like opening a file or
directory should create a new window, unless the 
file or directory you are opening is contained in
the current projects dir.
This commit is contained in:
Corey Johnson
2011-09-13 11:11:07 -07:00
parent 4f55f4d4a0
commit 3843285eba

View File

@@ -18,7 +18,10 @@ class Project extends Pane
'Command-Ctrl-N': 'toggle'
initialize: ->
@dir = File.workingDirectory()
@reload(File.workingDirectory())
activeWindow.document.ace.on 'open', ({filename}) =>
@reload filename if File.isDirectory filename
$('#project li').live 'click', (event) =>
$('#project .active').removeClass 'active'
@@ -38,8 +41,10 @@ class Project extends Pane
false # Don't bubble!
reload: (dir) ->
@dir = dir
@html.children('#project .cwd').text _.last @dir.split '/'
@html.children('#project li').remove()
@html.children('#project .files').empty()
@html.children('#project .files').append @createList @dir
createList: (dir) ->