mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Change Editor.proto.split method to use new RootView.proto.addPane method.
RootView.proto.addPane takes a view to add, a sibling to add it next to, an axis along which to add (row or column), and a side (before or after)
This commit is contained in:
@@ -78,6 +78,15 @@ class RootView extends View
|
||||
editor.appendTo(@panes)
|
||||
editor.focus()
|
||||
|
||||
|
||||
addPane: (view, sibling, axis, side) ->
|
||||
unless sibling.parent().hasClass(axis)
|
||||
container = $$ -> @div class: axis
|
||||
container.insertBefore(sibling).append(sibling.detach())
|
||||
sibling[side](view)
|
||||
@adjustSplitPanes()
|
||||
view
|
||||
|
||||
adjustSplitPanes: (element = @panes.children(':first'))->
|
||||
if element.hasClass('row')
|
||||
totalUnits = @horizontalGridUnits(element)
|
||||
|
||||
Reference in New Issue
Block a user