Don't store package state in command-panel package

The package loader now only calls serialize if activate
has been called and reuses the previous state if the package
is never activated.
This commit is contained in:
Kevin Sawicki
2013-02-14 17:30:43 -08:00
parent 992fbaafbc
commit ef4449d1ed

View File

@@ -3,15 +3,12 @@ CommandPanelView = require './command-panel-view'
module.exports =
commandPanelView: null
activate: (@state) ->
@commandPanelView = new CommandPanelView(@state)
activate: (state) ->
@commandPanelView = new CommandPanelView(state)
deactivate: ->
@commandPanelView?.destroy()
@commandPanelView = null
serialize: ->
if @commandPanelView?
@commandPanelView.serialize()
else
@state
@commandPanelView.serialize()