Use atom.workspace.getView to construct WorkspaceViews

It returns the root DOM node of the workspace. Eventually this will
be a custom element but for now it’s just a DOM node with a
__spacePenView reference on it.
This commit is contained in:
Nathan Sobo
2014-09-16 18:06:23 -06:00
parent 7baa3b6f09
commit 7f41be3103
6 changed files with 12 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ Editor = require './editor'
PaneContainer = require './pane-container'
Pane = require './pane'
{jQuery} = require './space-pen-extensions'
WorkspaceView = null
# Essential: Represents the state of the user interface for the entire window.
# An instance of this class is available via the `atom.workspace` global.
@@ -66,6 +67,9 @@ class Workspace extends Model
fullScreen: atom.isFullScreen()
packagesWithActiveGrammars: @getPackageNamesWithActiveGrammars()
getViewClass: ->
WorkspaceView ?= require './workspace-view'
getPackageNamesWithActiveGrammars: ->
packageNames = []
addGrammar = ({includedGrammarScopes, packageName}={}) ->