   (let [k (key-event->keycode e)]
     (when (legal-key k) 
       (condp = k
-        ENTER (new-search data state owner)
+        ENTER (do 
+                (when (not (empty? (:text state)))
+                  (set! js/window.location.hash ((-> @data :routes :search) 
+                                                 {:query (:text state)}))
+                  (om/set-state! owner :text "")))
         ESC   (om/set-state! owner :text "")))))
 
 ; render ---

                      (dom/button
                        #js {:onClick (fn [e]
                                        (.preventDefault e)
                                        (om/transact! data reset-state))}
                        "Reset"))
             ; item list
             (items-view data owner))))

              (put! ajax-chan {:error false
                               :search-term search-term
                               :items (filter 
                                        (fn [item] (= (:type item) "photo"))
                                        (js->clj (.. % -response) :keywordize-keys true))})
              ; otherwise error
              (put! ajax-chan {:error true})))))

(defn new-search [data query ajax-chan]
  (om/transact!
    data #(assoc %
                 :current-state :loading
                 :current-search query
                 :current-items []
                 :before 0
                 :window-width (.. js/window -innerWidth) 
                 ))
  (go (async-search @data ajax-chan)))

; Key handling ---

