Use atom.views.getView in WorkspaceView to preserve previous behavior

The status-bar package specs were calling atom.views.getView with the
workspace model *prior* to instantiating the SpacePen view. A weird
case, but might as well leave it working so the deprecation shim is
perfect.
Esse commit está contido em:
Nathan Sobo
2014-11-30 18:43:50 -07:00
commit 7e59be6461
2 arquivos alterados com 4 adições e 3 exclusões
+3 -2
Ver Arquivo
@@ -48,8 +48,9 @@ class ViewFactory
new Disposable =>
@providers = @providers.filter (provider) -> provider isnt providerSpec
getView: (object) ->
Grim.deprecate("Call ::getView on the workspace element instead. The atom.views global is only intended to create views.")
getView: (object, suppressDeprecationWarning) ->
unless suppressDeprecationWarning
Grim.deprecate("Call ::getView on the workspace element instead. The atom.views global is only intended to create views.")
@deprecatedViewRegistry.getView(object)
# Essential: Create an element for the given model object based on providers
+1 -1
Ver Arquivo
@@ -59,7 +59,7 @@ class WorkspaceView extends View
constructor: (@element) ->
unless @element?
return atom.views.createView(atom.workspace).__spacePenView
return atom.views.getView(atom.workspace, true).__spacePenView
super
@deprecateViewEvents()