Remove rootView as parameter to activate

This commit is contained in:
Corey Johnson & Kevin Sawicki 2013-02-08 12:13:58 -08:00
parent adb867cbd1
commit ac6ec1c2a7
7 changed files with 9 additions and 9 deletions

View File

@ -431,7 +431,7 @@ describe "RootView", ->
describe ".activatePackage(name, packageModule)", ->
it "calls activate on the package module", ->
rootView.activatePackage('package', packageModule)
expect(packageModule.activate).toHaveBeenCalledWith(rootView, undefined)
expect(packageModule.activate).toHaveBeenCalledWith(undefined)
it "calls activate on the package module with its previous state", ->
rootView.activatePackage('package', packageModule)
@ -439,7 +439,7 @@ describe "RootView", ->
newRootView = RootView.deserialize(rootView.serialize())
newRootView.activatePackage('package', packageModule)
expect(packageModule.activate).toHaveBeenCalledWith(newRootView, "it worked")
expect(packageModule.activate).toHaveBeenCalledWith("it worked")
newRootView.remove()
it "loads config defaults based on the `configDefaults` key", ->

View File

@ -136,7 +136,7 @@ class RootView extends View
activatePackage: (name, packageModule) ->
config.setDefaults(name, packageModule.configDefaults) if packageModule.configDefaults?
@packageModules[name] = packageModule
packageModule.activate(this, @packageStates[name])
packageModule.activate(@packageStates[name])
deactivatePackage: (name) ->
@packageModules[name].deactivate?()

View File

@ -5,7 +5,7 @@ module.exports =
commandLoggerView: null
originalTrigger: null
activate: (rootView, state={})->
activate: (state={})->
@eventLog = state.eventLog ? {}
rootView.command 'command-logger:clear-data', => @eventLog = {}
rootView.command 'command-logger:toggle', => @createView().toggle(@eventLog)

View File

@ -3,7 +3,7 @@ CommandPanelView = require './command-panel-view'
module.exports =
commandPanelView: null
activate: (rootView, @state) ->
activate: (@state) ->
@commandPanelView = new CommandPanelView(@state)
deactivate: ->

View File

@ -10,7 +10,7 @@ describe "StatusBar", ->
beforeEach ->
rootView = new RootView(require.resolve('fixtures/sample.js'))
rootView.simulateDomAttachment()
StatusBar.activate(rootView)
StatusBar.activate()
editor = rootView.getActiveEditor()
statusBar = rootView.find('.status-bar').view()
buffer = editor.getBuffer()
@ -38,7 +38,7 @@ describe "StatusBar", ->
rootView = new RootView
rootView.open()
rootView.simulateDomAttachment()
StatusBar.activate(rootView)
StatusBar.activate()
statusBar = rootView.find('.status-bar').view()
expect(statusBar.currentPath.text()).toBe 'untitled'
expect(statusBar.cursorPosition.text()).toBe '1,1'

View File

@ -1,5 +1,5 @@
module.exports =
activate: (rootView) ->
activate: ->
rootView.eachBuffer (buffer) => @stripTrailingWhitespaceBeforeSave(buffer)
stripTrailingWhitespaceBeforeSave: (buffer) ->

View File

@ -1,7 +1,7 @@
module.exports =
treeView: null
activate: (rootView, @state) ->
activate: (@state) ->
if state
@createView().attach() if state.attached
else if rootView.project.getPath() and not rootView.pathToOpenIsFile