Rename pane focusing methods on Workspace

This commit is contained in:
probablycorey 2014-02-18 15:31:19 -08:00 committed by Corey Johnson & Nathan Sobo
parent b042dffc2c
commit 245ad7a356
3 changed files with 40 additions and 40 deletions

View File

@ -240,30 +240,30 @@ describe "PaneContainerView", ->
pane2.remove()
expect(activeItemChangedHandler).not.toHaveBeenCalled()
describe ".focusNextPane()", ->
describe ".focusNextPaneView()", ->
it "focuses the pane following the focused pane or the first pane if no pane has focus", ->
container.attachToDom()
container.focusNextPane()
container.focusNextPaneView()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusNextPane()
container.focusNextPaneView()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusNextPane()
container.focusNextPaneView()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusNextPane()
container.focusNextPaneView()
expect(pane1.activeItem).toMatchSelector ':focus'
describe ".focusPreviousPane()", ->
describe ".focusPreviousPaneView()", ->
it "focuses the pane preceding the focused pane or the last pane if no pane has focus", ->
container.attachToDom()
container.getPaneViews()[0].focus() # activate first pane
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane3.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane2.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane1.activeItem).toMatchSelector ':focus'
container.focusPreviousPane()
container.focusPreviousPaneView()
expect(pane3.activeItem).toMatchSelector ':focus'
describe "changing focus directionally between panes", ->
@ -300,54 +300,54 @@ describe "PaneContainerView", ->
container.width(400)
container.attachToDom()
describe ".focusPaneAbove()", ->
describe ".focusPaneViewAbove()", ->
describe "when there are multiple rows above the focused pane", ->
it "focuses up to the adjacent row", ->
pane8.focus()
container.focusPaneAbove()
container.focusPaneViewAbove()
expect(pane5.activeItem).toMatchSelector ':focus'
describe "when there are no rows above the focused pane", ->
it "keeps the current pane focused", ->
pane2.focus()
container.focusPaneAbove()
container.focusPaneViewAbove()
expect(pane2.activeItem).toMatchSelector ':focus'
describe ".focusPaneBelow()", ->
describe ".focusPaneViewBelow()", ->
describe "when there are multiple rows below the focused pane", ->
it "focuses down to the adjacent row", ->
pane2.focus()
container.focusPaneBelow()
container.focusPaneViewBelow()
expect(pane5.activeItem).toMatchSelector ':focus'
describe "when there are no rows below the focused pane", ->
it "keeps the current pane focused", ->
pane8.focus()
container.focusPaneBelow()
container.focusPaneViewBelow()
expect(pane8.activeItem).toMatchSelector ':focus'
describe ".focusPaneOnLeft()", ->
describe ".focusPaneViewOnLeft()", ->
describe "when there are multiple columns to the left of the focused pane", ->
it "focuses left to the adjacent column", ->
pane6.focus()
container.focusPaneOnLeft()
container.focusPaneViewOnLeft()
expect(pane5.activeItem).toMatchSelector ':focus'
describe "when there are no columns to the left of the focused pane", ->
it "keeps the current pane focused", ->
pane4.focus()
container.focusPaneOnLeft()
container.focusPaneViewOnLeft()
expect(pane4.activeItem).toMatchSelector ':focus'
describe ".focusPaneOnRight()", ->
describe ".focusPaneViewOnRight()", ->
describe "when there are multiple columns to the right of the focused pane", ->
it "focuses right to the adjacent column", ->
pane4.focus()
container.focusPaneOnRight()
container.focusPaneViewOnRight()
expect(pane5.activeItem).toMatchSelector ':focus'
describe "when there are no columns to the right of the focused pane", ->
it "keeps the current pane focused", ->
pane6.focus()
container.focusPaneOnRight()
container.focusPaneViewOnRight()
expect(pane6.activeItem).toMatchSelector ':focus'

View File

@ -91,22 +91,22 @@ class PaneContainerView extends View
paneForUri: (uri) ->
@viewForModel(@model.paneForUri(uri))
focusNextPane: ->
focusNextPaneView: ->
@model.activateNextPane()
focusPreviousPane: ->
focusPreviousPaneView: ->
@model.activatePreviousPane()
focusPaneAbove: ->
focusPaneViewAbove: ->
@nearestPaneInDirection('above')?.focus()
focusPaneBelow: ->
focusPaneViewBelow: ->
@nearestPaneInDirection('below')?.focus()
focusPaneOnLeft: ->
focusPaneViewOnLeft: ->
@nearestPaneInDirection('left')?.focus()
focusPaneOnRight: ->
focusPaneViewOnRight: ->
@nearestPaneInDirection('right')?.focus()
nearestPaneInDirection: (direction) ->

View File

@ -119,12 +119,12 @@ class WorkspaceView extends View
@command 'window:decrease-font-size', => @decreaseFontSize()
@command 'window:reset-font-size', => @model.resetFontSize()
@command 'window:focus-next-pane', => @focusNextPane()
@command 'window:focus-previous-pane', => @focusPreviousPane()
@command 'window:focus-pane-above', => @focusPaneAbove()
@command 'window:focus-pane-below', => @focusPaneBelow()
@command 'window:focus-pane-on-left', => @focusPaneOnLeft()
@command 'window:focus-pane-on-right', => @focusPaneOnRight()
@command 'window:focus-next-pane', => @focusNextPaneView()
@command 'window:focus-previous-pane', => @focusPreviousPaneView()
@command 'window:focus-pane-above', => @focusPaneViewAbove()
@command 'window:focus-pane-below', => @focusPaneViewBelow()
@command 'window:focus-pane-on-left', => @focusPaneViewOnLeft()
@command 'window:focus-pane-on-right', => @focusPaneViewOnRight()
@command 'window:save-all', => @saveAll()
@command 'window:toggle-invisibles', =>
atom.config.toggle("editor.showInvisibles")
@ -246,22 +246,22 @@ class WorkspaceView extends View
@panes.getActiveView()
# Public: Focuses the previous pane by id.
focusPreviousPane: -> @model.activatePreviousPane()
focusPreviousPaneView: -> @model.activatePreviousPane()
# Public: Focuses the next pane by id.
focusNextPane: -> @model.activateNextPane()
focusNextPaneView: -> @model.activateNextPane()
# Public: Focuses the pane directly above the active pane.
focusPaneAbove: -> @panes.focusPaneAbove()
focusPaneViewAbove: -> @panes.focusPaneViewAbove()
# Public: Focuses the pane directly below the active pane.
focusPaneBelow: -> @panes.focusPaneBelow()
focusPaneViewBelow: -> @panes.focusPaneViewBelow()
# Public: Focuses the pane directly to the left of the active pane.
focusPaneOnLeft: -> @panes.focusPaneOnLeft()
focusPaneViewOnLeft: -> @panes.focusPaneViewOnLeft()
# Public: Focuses the pane directly to the right of the active pane.
focusPaneOnRight: -> @panes.focusPaneOnRight()
focusPaneViewOnRight: -> @panes.focusPaneViewOnRight()
# Public:
#