From 2ffc0cf13def8244b28cdbbf3afe2ce1242ae830 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki & Nathan Sobo Date: Fri, 4 Jan 2013 11:12:45 -0700 Subject: [PATCH] Rename 'active-editor-path-change' to 'root-view:active-path-changed' --- spec/app/root-view-spec.coffee | 8 ++++---- src/app/root-view.coffee | 6 +++--- src/packages/tree-view/src/tree-view.coffee | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/app/root-view-spec.coffee b/spec/app/root-view-spec.coffee index cb3267598..102a1d906 100644 --- a/spec/app/root-view-spec.coffee +++ b/spec/app/root-view-spec.coffee @@ -479,9 +479,9 @@ describe "RootView", -> expect(keybindings["meta-a"]).toEqual "test-event-a" describe "when the focused editor changes", -> - it "changes the title and emits an active-editor-path-change event", -> + it "changes the title and emits an root-view:active-path-changed event", -> pathChangeHandler = jasmine.createSpy 'pathChangeHandler' - rootView.on 'active-editor-path-change', pathChangeHandler + rootView.on 'root-view:active-path-changed', pathChangeHandler editor1 = rootView.getActiveEditor() expect(rootView.getTitle()).toBe "#{fs.base(editor1.getPath())} – #{rootView.project.getPath()}" @@ -507,9 +507,9 @@ describe "RootView", -> expect(rootView.project.getPath()).toBe '/tmp' describe "when editors are focused", -> - it "triggers 'active-editor-path-change' events if the path of the active editor actually changes", -> + it "triggers 'root-view:active-path-changed' events if the path of the active editor actually changes", -> pathChangeHandler = jasmine.createSpy 'pathChangeHandler' - rootView.on 'active-editor-path-change', pathChangeHandler + rootView.on 'root-view:active-path-changed', pathChangeHandler editor1 = rootView.getActiveEditor() editor2 = rootView.getActiveEditor().splitLeft() diff --git a/src/app/root-view.coffee b/src/app/root-view.coffee index 816de9ab5..624132c78 100644 --- a/src/app/root-view.coffee +++ b/src/app/root-view.coffee @@ -71,7 +71,7 @@ class RootView extends View $(window).on 'focus', (e) => @handleFocus(e) if document.activeElement is document.body - @on 'active-editor-path-change', (e, path) => + @on 'root-view:active-path-changed', (e, path) => @project.setPath(path) unless @project.getRootDirectory() if path @setTitle(fs.base(path)) @@ -175,9 +175,9 @@ class RootView extends View if not editor.mini editor.on 'editor:path-changed.root-view', => - @trigger 'active-editor-path-change', editor.getPath() + @trigger 'root-view:active-path-changed', editor.getPath() if not previousActiveEditor or editor.getPath() != previousActiveEditor.getPath() - @trigger 'active-editor-path-change', editor.getPath() + @trigger 'root-view:active-path-changed', editor.getPath() activeKeybindings: -> keymap.bindingsForElement(document.activeElement) diff --git a/src/packages/tree-view/src/tree-view.coffee b/src/packages/tree-view/src/tree-view.coffee index bf918a550..83ba128d3 100644 --- a/src/packages/tree-view/src/tree-view.coffee +++ b/src/packages/tree-view/src/tree-view.coffee @@ -61,7 +61,7 @@ class TreeView extends ScrollView @selectActiveFile() @rootView.command 'tree-view:toggle', => @toggle() @rootView.command 'tree-view:reveal-active-file', => @revealActiveFile() - @rootView.on 'active-editor-path-change', => @selectActiveFile() + @rootView.on 'root-view:active-path-changed', => @selectActiveFile() @rootView.project.on 'path-change', => @updateRoot() @observeConfig 'core.hideGitIgnoredFiles', => @updateRoot()