diff --git a/src/pane-container-element.coffee b/src/pane-container-element.coffee index 65ee9ecea..55d527971 100644 --- a/src/pane-container-element.coffee +++ b/src/pane-container-element.coffee @@ -1,4 +1,5 @@ {CompositeDisposable} = require 'event-kit' +Grim = require 'grim' {callAttachHooks} = require './space-pen-extensions' PaneContainerView = null _ = require 'underscore-plus' @@ -8,12 +9,14 @@ class PaneContainerElement extends HTMLElement createdCallback: -> @subscriptions = new CompositeDisposable @classList.add 'panes' - PaneContainerView ?= require './pane-container-view' - @__spacePenView = new PaneContainerView(this) + + if Grim.includeDeprecations + PaneContainerView ?= require './pane-container-view' + @__spacePenView = new PaneContainerView(this) initialize: (@model) -> @subscriptions.add @model.observeRoot(@rootChanged.bind(this)) - @__spacePenView.setModel(@model) + @__spacePenView.setModel(@model) if Grim.includeDeprecations this rootChanged: (root) -> diff --git a/src/pane-element.coffee b/src/pane-element.coffee index f626e9fad..f050567b2 100644 --- a/src/pane-element.coffee +++ b/src/pane-element.coffee @@ -1,6 +1,7 @@ {CompositeDisposable} = require 'event-kit' +Grim = require 'grim' {$, callAttachHooks, callRemoveHooks} = require './space-pen-extensions' -PaneView = require './pane-view' +PaneView = null class PaneElement extends HTMLElement attached: false @@ -12,7 +13,7 @@ class PaneElement extends HTMLElement @initializeContent() @subscribeToDOMEvents() - @createSpacePenShim() + @createSpacePenShim() if Grim.includeDeprecations attachedCallback: -> @attached = true @@ -41,6 +42,7 @@ class PaneElement extends HTMLElement @addEventListener 'blur', handleBlur, true createSpacePenShim: -> + PaneView ?= require './pane-view' @__spacePenView = new PaneView(this) initialize: (@model) -> @@ -49,7 +51,7 @@ class PaneElement extends HTMLElement @subscriptions.add @model.observeActiveItem(@activeItemChanged.bind(this)) @subscriptions.add @model.onDidRemoveItem(@itemRemoved.bind(this)) @subscriptions.add @model.onDidDestroy(@paneDestroyed.bind(this)) - @__spacePenView.setModel(@model) + @__spacePenView.setModel(@model) if Grim.includeDeprecations this getModel: -> @model