mirror of
https://github.com/atom/atom.git
synced 2026-02-09 22:24:59 -05:00
RootView emits an 'active-editor-path-change' event whenever the path of the active editor changes for any reason (buffer path change, new buffer opened, focus changes)
This commit is contained in:
@@ -81,16 +81,16 @@ class RootView extends View
|
||||
|
||||
editorFocused: (editor) ->
|
||||
if @panes.containsElement(editor)
|
||||
@panes.find('.editor')
|
||||
.removeClass('active')
|
||||
.off('.root-view')
|
||||
previousActiveEditor = @panes.find('.editor.active').view()
|
||||
previousActiveEditor?.removeClass('active').off('.root-view')
|
||||
|
||||
editor
|
||||
.addClass('active')
|
||||
.on 'editor-path-change.root-view', =>
|
||||
@trigger 'active-editor-path-change', editor.buffer.path
|
||||
|
||||
@trigger 'active-editor-path-change', editor.buffer.path
|
||||
if not previousActiveEditor or editor.buffer.path != previousActiveEditor.buffer.path
|
||||
@trigger 'active-editor-path-change', editor.buffer.path
|
||||
|
||||
setTitle: (title='untitled') ->
|
||||
document.title = title
|
||||
|
||||
Reference in New Issue
Block a user