         type     : "dashboard"
         indexKey : "dashboard"
 
+    @registerPaneRemoveListener_ @dashboard
 
   createDrawingBoard: (sessionKey, indexKey) ->
     indexKey  = indexKey or @createSessionKey()

        indexKey  : indexKey

    @workspace.addToHistory "$0 opened a new browser"

  createChat: ->
    pane = new KDTabPaneView title: "Chat"

        sessionKey : drawing.sessionKey
        indexKey   : indexKey

    @registerPaneRemoveListener_ pane

  registerPaneRemoveListener_: (pane) ->
    pane.on "KDObjectWillBeDestroyed", =>
      paneIndexKey = pane.getOptions().indexKey

      @keysRef.once "value", (snapshot) =>
        data = snapshot.val()
        return unless data

        for key, value of data
          if value.indexKey is paneIndexKey
            @keysRef.child(key).remove()

  createEditor: (file, content = "", sessionKey, indexKey) ->
    isLocal  = not file
