Rename Editor attach and remove events in accordance w/ new scheme

'editor-open' -> 'editor:attached'
'before-remove' -> 'editor:will-be-removed'
This commit is contained in:
Kevin Sawicki & Nathan Sobo
2013-01-04 11:19:09 -07:00
parent 8e835acea4
commit 8098ee69f3
7 changed files with 10 additions and 10 deletions

View File

@@ -451,10 +451,10 @@ describe "Editor", ->
editor.splitLeft().remove()
editor.splitRight().remove()
describe "editor-open event", ->
it 'only triggers an editor-open event when it is first added to the DOM', ->
describe "editor:attached event", ->
it 'only triggers an editor:attached event when it is first added to the DOM', ->
openHandler = jasmine.createSpy('openHandler')
editor.on 'editor-open', openHandler
editor.on 'editor:attached', openHandler
editor.simulateDomAttachment()
expect(openHandler).toHaveBeenCalled()

View File

@@ -422,7 +422,7 @@ class Editor extends View
@resetDisplay()
@trigger 'editor-open', [this]
@trigger 'editor:attached', [this]
edit: (editSession) ->
index = @editSessions.indexOf(editSession)
@@ -680,7 +680,7 @@ class Editor extends View
remove: (selector, keepData) ->
return super if keepData
@trigger 'before-remove'
@trigger 'editor:will-be-removed'
@destroyEditSessions()

View File

@@ -6,7 +6,7 @@ module.exports =
class Autocomplete extends SelectList
@activate: (rootView) ->
new Autocomplete(editor) for editor in rootView.getEditors()
rootView.on 'editor-open', (e, editor) -> new Autocomplete(editor) unless editor.mini
rootView.on 'editor:attached', (e, editor) -> new Autocomplete(editor) unless editor.mini
@viewClass: -> "autocomplete #{super}"

View File

@@ -10,7 +10,7 @@ module.exports =
activate: (@rootView) ->
@loadSnippets()
@rootView.on 'editor-open', (e, editor) => @enableSnippetsInEditor(editor)
@rootView.on 'editor:attached', (e, editor) => @enableSnippetsInEditor(editor)
loadSnippets: ->
snippetsDir = fs.join(config.configDirPath, 'snippets')

View File

@@ -8,7 +8,7 @@ class StatusBar extends View
for editor in rootView.getEditors()
@appendToEditorPane(rootView, editor) if rootView.parents('html').length
rootView.on 'editor-open', (e, editor) =>
rootView.on 'editor:attached', (e, editor) =>
@appendToEditorPane(rootView, editor)
@appendToEditorPane: (rootView, editor) ->

View File

@@ -8,7 +8,7 @@ class Tabs extends View
for editor in rootView.getEditors()
@prependToEditorPane(rootView, editor) if rootView.parents('html').length
rootView.on 'editor-open', (e, editor) =>
rootView.on 'editor:attached', (e, editor) =>
@prependToEditorPane(rootView, editor)
@prependToEditorPane: (rootView, editor) ->

View File

@@ -9,7 +9,7 @@ class WrapGuide extends View
if rootView.parents('html').length
@appendToEditorPane(rootView, editor)
rootView.on 'editor-open', (e, editor) =>
rootView.on 'editor:attached', (e, editor) =>
@appendToEditorPane(rootView, editor)
@appendToEditorPane: (rootView, editor, config) ->