   (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 ---

            [om.core :as om :include-macros true]
            [om.dom :as dom :include-macros true]
            [clojure.string :as s :refer [replace]]
            ;[figwheel.client :as fw :include-macros true]
            )
  (:import [goog.net Jsonp]
           [goog Uri]
           ))

(enable-console-print!)

              (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 ---

