mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
When a Pane is removed, layout of #panes div is adjusted appropriately
This commit is contained in:
@@ -494,16 +494,16 @@ class Editor extends View
|
||||
@setCursorBufferPosition(fold.start)
|
||||
|
||||
splitLeft: ->
|
||||
@pane()?.splitLeft(@copy())
|
||||
@pane()?.splitLeft(@copy()).wrappedView
|
||||
|
||||
splitRight: ->
|
||||
@pane()?.splitRight(@copy())
|
||||
@pane()?.splitRight(@copy()).wrappedView
|
||||
|
||||
splitUp: ->
|
||||
@pane()?.splitUp(@copy())
|
||||
@pane()?.splitUp(@copy()).wrappedView
|
||||
|
||||
splitDown: ->
|
||||
@pane()?.splitDown(@copy())
|
||||
@pane()?.splitDown(@copy()).wrappedView
|
||||
|
||||
pane: ->
|
||||
@parent('.pane').view()
|
||||
|
||||
@@ -44,7 +44,18 @@ class Pane extends View
|
||||
pane = new Pane(view)
|
||||
this[side](pane)
|
||||
@rootView().adjustPaneDimensions()
|
||||
view
|
||||
pane
|
||||
|
||||
remove: (selector, keepData) ->
|
||||
return super if keepData
|
||||
# find parent elements before removing from dom
|
||||
parentAxis = @parent('.row, .column')
|
||||
rootView = @rootView()
|
||||
super
|
||||
if parentAxis.children().length == 1
|
||||
sibling = parentAxis.children().detach()
|
||||
parentAxis.replaceWith(sibling)
|
||||
rootView.adjustPaneDimensions()
|
||||
|
||||
buildPaneAxis: (axis) ->
|
||||
switch axis
|
||||
|
||||
@@ -107,6 +107,7 @@ class RootView extends View
|
||||
|
||||
adjustPaneDimensions: ->
|
||||
rootPane = @panes.children().first().view()
|
||||
rootPane?.css(width: '100%', height: '100%')
|
||||
rootPane?.adjustDimensions()
|
||||
|
||||
toggleFileFinder: ->
|
||||
|
||||
Reference in New Issue
Block a user