Remove RootView.proto.editorRemoved. Transfer remaining logic to Editor.proto.remove

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-04-13 14:22:45 -06:00
parent 57b205d508
commit 65c624f2bf
2 changed files with 2 additions and 13 deletions

View File

@@ -512,12 +512,8 @@ class Editor extends View
return super if keepData
@unsubscribeFromBuffer()
rootView = @rootView()
pane = @parent('.pane')
paneParent = pane.parent()
super
pane.remove()
paneParent.remove() if paneParent.is('.row:empty, .column:empty')
rootView?.editorRemoved(this)
if @pane() then @pane.remove() else super
rootView?.focus()
unsubscribeFromBuffer: ->
@buffer.off ".editor#{@id}"

View File

@@ -77,13 +77,6 @@ class RootView extends View
@setTitle(editor.buffer.path)
editorRemoved: (editor) ->
@adjustPaneDimensions()
if @editors().length
@editors()[0].focus()
else
@focus()
setTitle: (title='untitled') ->
document.title = title