Allow WorkspaceView to be instantiated directly for compatibility

This commit is contained in:
Nathan Sobo
2014-09-25 20:17:04 -06:00
parent edaf1e2ced
commit 039d87caa0

View File

@@ -10,6 +10,7 @@ fs = require 'fs-plus'
PaneView = require './pane-view'
PaneContainerView = require './pane-container-view'
Editor = require './editor'
Workspace = require './workspace'
# Extended: The top-level view for the entire window. An instance of this class is
# available via the `atom.workspaceView` global.
@@ -66,7 +67,9 @@ class WorkspaceView extends View
destroyEmptyPanes: true
constructor: (@element) ->
@element ?= atom.workspace.getView(atom.workspace)
super
@setModel(atom.workspace) unless @model?
@deprecateViewEvents()
setModel: (@model) ->