mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add all Tool Panel append and prepend methods
This commit is contained in:
@@ -111,7 +111,7 @@ describe "WorkspaceView", ->
|
||||
it "passes focus to the first focusable element", ->
|
||||
focusable1 = $$ -> @div "One", id: 'one', tabindex: -1
|
||||
focusable2 = $$ -> @div "Two", id: 'two', tabindex: -1
|
||||
atom.workspaceView.horizontal.append(focusable1, focusable2)
|
||||
atom.workspaceView.appendToLeft(focusable1, focusable2)
|
||||
expect(document.activeElement).toBe document.body
|
||||
|
||||
atom.workspaceView.focus()
|
||||
@@ -120,7 +120,7 @@ describe "WorkspaceView", ->
|
||||
describe "when there are no visible focusable elements", ->
|
||||
it "surrenders focus to the body", ->
|
||||
focusable = $$ -> @div "One", id: 'one', tabindex: -1
|
||||
atom.workspaceView.horizontal.append(focusable)
|
||||
atom.workspaceView.appendToLeft(focusable)
|
||||
focusable.hide()
|
||||
expect(document.activeElement).toBe document.body
|
||||
|
||||
|
||||
@@ -272,12 +272,38 @@ class WorkspaceView extends View
|
||||
getOpenBufferPaths: ->
|
||||
_.uniq(_.flatten(@getEditorViews().map (editorView) -> editorView.getOpenBufferPaths()))
|
||||
|
||||
prependToBottom: (element)->
|
||||
# Public: Prepends the element to the top of the window.
|
||||
prependToTop: (element) ->
|
||||
@vertical.prepend(element)
|
||||
|
||||
# Public: Appends the element to the top of the window.
|
||||
appendToTop: (element) ->
|
||||
@panes.before(element)
|
||||
|
||||
# Public: Prepends the element to the bottom of the window.
|
||||
prependToBottom: (element) ->
|
||||
@panes.after(element)
|
||||
|
||||
appendToBottom: (element)->
|
||||
# Public: Appends the element to bottom of the window.
|
||||
appendToBottom: (element) ->
|
||||
@vertical.append(element)
|
||||
|
||||
# Public: Prepends the element to the left side of the window.
|
||||
prependToLeft: (element) ->
|
||||
@horizontal.prepend(element)
|
||||
|
||||
# Public: Appends the element to the left side of the window.
|
||||
appendToLeft: (element) ->
|
||||
@vertical.before(element)
|
||||
|
||||
# Public: Prepends the element to the right side of the window.
|
||||
prependToRight: (element) ->
|
||||
@vertical.after(element)
|
||||
|
||||
# Public: Appends the element to the right side of the window.
|
||||
appendToRight: (element) ->
|
||||
@horizontal.append(element)
|
||||
|
||||
# Public: Returns the currently focused {Pane}.
|
||||
getActivePane: ->
|
||||
@panes.getActivePane()
|
||||
|
||||
Reference in New Issue
Block a user