mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Migrate to new RootView serialization scheme
This commit is contained in:
@@ -23,9 +23,13 @@ class RootView extends View
|
||||
@div id: 'vertical', outlet: 'vertical', =>
|
||||
@div id: 'panes', outlet: 'panes'
|
||||
|
||||
@deserialize: ({ projectState, panesViewState, packageStates }) ->
|
||||
project = Project.deserialize(projectState) if projectState
|
||||
rootView = new RootView(project, packageStates: packageStates, suppressOpen: true)
|
||||
@deserialize: ({ projectState, panesViewState, packageStates, projectPath }) ->
|
||||
if projectState
|
||||
projectOrPathToOpen = Project.deserialize(projectState)
|
||||
else
|
||||
projectOrPathToOpen = projectPath # This will migrate people over to the new project serialization scheme. It should be removed eventually.
|
||||
|
||||
rootView = new RootView(projectOrPathToOpen , packageStates: packageStates, suppressOpen: true)
|
||||
rootView.setRootPane(rootView.deserializeView(panesViewState)) if panesViewState
|
||||
rootView
|
||||
|
||||
@@ -38,7 +42,7 @@ class RootView extends View
|
||||
@packageStates ?= {}
|
||||
@packageModules = {}
|
||||
|
||||
if not projectOrPathToOpen or _.isString(projectOrPathToOpen)
|
||||
if not projectOrPathToOpen or _.isString(projectOrPathToOpen)
|
||||
pathToOpen = projectOrPathToOpen
|
||||
@project = new Project(projectOrPathToOpen)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user