Merge branch 'focus-editor-when-selecting-tab' into dev

This commit is contained in:
Corey Johnson & Nathan Sobo
2013-01-24 09:55:10 -08:00
3 changed files with 10 additions and 1 deletions

View File

@@ -708,7 +708,7 @@ class Editor extends View
"Your changes will be lost if you don't save them"
"Save", => @save(session, callback),
"Cancel", null
"Don't save", callback
"Don't Save", callback
)
remove: (selector, keepData) ->

View File

@@ -75,6 +75,14 @@ describe "Tabs", ->
tabs.find('.tab:eq(1)').click()
expect(editor.getActiveEditSessionIndex()).toBe 1
it "focuses the associated editor", ->
rootView.attachToDom()
expect(editor).toMatchSelector ":has(:focus)"
editor.splitRight()
expect(editor).not.toMatchSelector ":has(:focus)"
tabs.find('.tab:eq(0)').click()
expect(editor).toMatchSelector ":has(:focus)"
describe "when a file name associated with a tab changes", ->
[buffer, oldPath, newPath] = []

View File

@@ -26,6 +26,7 @@ class Tabs extends View
@on 'click', '.tab', (e) =>
@editor.setActiveEditSessionIndex($(e.target).closest('.tab').index())
@editor.focus()
@on 'click', '.tab .close-icon', (e) =>
index = $(e.target).closest('.tab').index()