Editors in #panes are always contained by .pane wrappers

This prepares us to refactor the split view and editor state code into Column, Row, and Pane objects.
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-04-11 18:37:22 -06:00
parent 8a4b5b13bb
commit 416a15e3af
6 changed files with 79 additions and 56 deletions

View File

@@ -506,15 +506,17 @@ class Editor extends View
split: (axis, side) ->
return unless rootView = @rootView()
editor = new Editor(@getEditorState())
rootView.addPane(editor, this, axis, side)
rootView.addPane(editor, this.parent(), axis, side)
remove: (selector, keepData) ->
return super if keepData
@unsubscribeFromBuffer()
rootView = @rootView()
parent = @parent()
pane = @parent('.pane')
paneParent = pane.parent()
super
parent.remove() if parent.is('.row:empty, .column:empty')
pane.remove()
paneParent.remove() if paneParent.is('.row:empty, .column:empty')
rootView?.editorRemoved(this)
unsubscribeFromBuffer: ->