     (render [_]
       (dom/div #js {:className "container"}
         (om/build title-field app)
-        (om/build new-document app)
+        (om/build new-button app)
         (om/build save-button app)
         (om/build left-menu app)
         (om/build editor (:input app))))))


;; New document

(defn new-document [app owner]
  (reify
    om/IRender
    (render [_]
      (dom/span #js {:id "new-document"} "+"))))

;; Left menu


  
(defn remove-document [app title]
  (p/remove-document title)
  (om/update! app :titles (p/get-all-titles))
  (when (= (:title @app) title)
    (reset-document-state! app)))

(defn dispatch [command params app]
  (case command
    :save   (save-document app)
    :rename (rename-document app params)
    :remove (remove-document app params)
    :change (change-document app params)
    :new    (new-document app)))

(defn listen [el type app]
  (events/listen el type
