 (defn annotate-editor
   [pos item]
   (let [title (get item "title")]
-    (nm "div" [(e/text "title" title 40 #(update_field "title" pos %))])))
+    (nm "div" [(e/text "title" title 40 #(update_field pos "title" %))])))
 
 (defn annotate-button
   [pos item]

(defn reporender
  "Render repository trees"
  []
  (let [tree (get (querydb [:data]) "tree")]
    (map-indexed node tree)))



  (let [editing (querydb [:editing])]
    (updatedb [:editing] (conj editing pos))))

(defn save [item pos]
  "Save item to db :data into position"
  (let [doc (assoc item "mtime" (str (new js/Date)))
        data (querydb [:data])]
    (updatedb [:data] (assoc data pos doc))
    (println "Saved!" (get doc "path"))))

(defn update_field [pos key value]
  (let [prev (querydb [:data pos])
        item (assoc prev key value)]
    (println "Editing: " pos key value)
    (save item pos)))

(defn close
  [pos]
