         level (count parts)
         base (last parts)
         icon (if (blob? item) (ftype-to-icon base) (nm "i.ftype.fa.fa-folder-open-o"))]
-    (nm "div.pure-g" [(nm "div.pure-u-1.pure-u-sm-1-2" [(nm (str "div.level" level) [icon base])])
-                      (annotate index item)])))
+    (nm "div.pure-g" [(nm "div.pure-u-1.pure-u-sm-1-2"
+                          [(nm (str "div.level" level) {:onclick #(toggle-item-detail index)} [icon base])])
+                      (annotate index item)
+                      (item-detail index item)])))
 
 (defn reporender
   "Render repository trees"


(defn querydb [fields]
  (get-in db fields))

(defn edit [pos]
  (let [editing (querydb [:editing])]


(def db {:data (get REPO "tree")
         :start 0
         :editing #{}
         :opened #{}})

(defn ^:export updatedb [fields value]
  (set! db (assoc-in db fields value))
