Some app errors

This commit is contained in:
Corey Johnson
2011-09-20 13:44:25 -07:00
parent 1d562dce58
commit 9eee6ad9ad
2 changed files with 7 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ Plugins = require 'plugins'
module.exports =
class App
@windows: []
@root: OSX.NSBundle.mainBundle.resourcePath
@activeWindow: null
@@ -13,8 +14,8 @@ class App
@setActiveWindow new Window controller : WindowController
# Move this someone more approriate
if localStorage.lastOpenedFilename
@activeWindow.open(localStorage.lastOpenedFilename)
if localStorage.lastOpenedPath
@activeWindow.open localStorage.lastOpenedPath
Plugins.load()
@activeWindow.document.ace._emit "loaded"

View File

@@ -57,11 +57,12 @@ class Editor extends Pane
save: ->
return @saveAs() if not @filename
@removeTrailingWhitespace()
File.write @filename, @code()
@sessions[@filename] = @ace.getSession()
.setDirty false
App = require 'app' # Get rid of this!
App.activeWindow.setDirty false
@ace._emit 'save', { @filename }
open: (path) ->
@@ -93,6 +94,7 @@ class Editor extends Pane
saveAs: ->
if file = Chrome.savePanel()
@filename = file
App = require 'app' # Get rid of this!
App.activeWindow.setTitle _.last @filename.split '/'
@save()