   getPanels: -> @panels
 
   addPanel: (panel) ->
-    @subscriptions.add panel.onDidDestroy(@panelDestoryed.bind(this))
+    @subscriptions.add panel.onDidDestroy(@panelDestroyed.bind(this))
 
     index = @getPanelIndex(panel)
     if index is @panels.length

    @panels = []

  destroy: ->
    pane.destroy() for pane in @getPanels()
    @subscriptions.dispose()
    @emitter.emit 'did-destroy', this
    @emitter.dispose()

    @emitter.emit 'did-add-panel', {panel, index}
    panel

  panelDestroyed: (panel) ->
    index = @panels.indexOf(panel)
    if index > -1
      @panels.splice(index, 1)
