Return subscription from RootView.eachEditor()

This commit is contained in:
Kevin Sawicki
2013-06-12 11:37:49 -07:00
parent 65b08e2914
commit 04c5e9fa42
2 changed files with 15 additions and 1 deletions

View File

@@ -205,7 +205,9 @@ class RootView extends View
# callback - A {Function} to call
eachEditor: (callback) ->
callback(editor) for editor in @getEditors()
@on 'editor:attached', (e, editor) -> callback(editor)
attachedCallback = (e, editor) -> callback(editor)
@on('editor:attached', attachedCallback)
off: => @off('editor:attached', attachedCallback)
# Fires a callback on each open {EditSession}.
#