Now storing a window's state based on its rootDirectory (instead of on windowNumber)

This commit is contained in:
Corey Johnson
2012-08-29 10:59:45 -07:00
parent 073164c584
commit 6f99b61dd3
7 changed files with 30 additions and 19 deletions

View File

@@ -25,14 +25,12 @@ windowAdditions =
@shutdown()
false
$(window).focus()
# atom.windowOpened this # TODO: Reinstate this!
shutdown: ->
@rootView.deactivate()
$(window).unbind('focus')
$(window).unbind('blur')
$(window).off('before')
# atom.windowClosed this # TODO: Reinstate this!
setUpKeymap: ->
Keymap = require 'keymap'
@@ -47,8 +45,8 @@ windowAdditions =
# Note: RootView assigns itself on window on initialization so that
# window.rootView is available when loading user configuration
attachRootView: (pathToOpen) ->
if rootViewState = atom.rootViewStates?[$windowNumber]
RootView.deserialize(JSON.parse(rootViewState))
if rootViewState = atom.getRootViewStateForPath(pathToOpen)
RootView.deserialize(rootViewState)
else
new RootView(pathToOpen)
@rootView.open() unless pathToOpen