Add RootView.proto.focusNextPane

This commit is contained in:
Nathan Sobo
2012-06-18 20:27:39 -06:00
parent 171a19369a
commit c21766c328
2 changed files with 34 additions and 0 deletions

View File

@@ -140,6 +140,15 @@ class RootView extends View
else
@panes.find('.editor:first').view()
focusNextPane: ->
panes = @panes.find('.pane')
currentIndex = panes.toArray().indexOf(@getFocusedPane()[0])
nextIndex = (currentIndex + 1) % panes.length
panes.eq(nextIndex).view().wrappedView.focus()
getFocusedPane: ->
@panes.find('.pane:has(:focus)')
setRootPane: (pane) ->
@panes.empty()
@panes.append(pane)