mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Remove rootView as parameter to activate
This commit is contained in:
parent
adb867cbd1
commit
ac6ec1c2a7
@ -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", ->
|
||||
|
@ -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?()
|
||||
|
@ -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)
|
||||
|
@ -3,7 +3,7 @@ CommandPanelView = require './command-panel-view'
|
||||
module.exports =
|
||||
commandPanelView: null
|
||||
|
||||
activate: (rootView, @state) ->
|
||||
activate: (@state) ->
|
||||
@commandPanelView = new CommandPanelView(@state)
|
||||
|
||||
deactivate: ->
|
||||
|
@ -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'
|
||||
|
@ -1,5 +1,5 @@
|
||||
module.exports =
|
||||
activate: (rootView) ->
|
||||
activate: ->
|
||||
rootView.eachBuffer (buffer) => @stripTrailingWhitespaceBeforeSave(buffer)
|
||||
|
||||
stripTrailingWhitespaceBeforeSave: (buffer) ->
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user