   (let [editable-cells ($ :td.editable)]
     (.attr editable-cells "contentEditable" true)
     (.attr (jq/find editable-cells "a") "contentEditable" false)
-    (bind editable-cells "click" (juxt expand-editable-text mark-in-progress))
+    (bind editable-cells "click" (juxt expand-editable-text (partial set-edit-state "edit-in-progress")))
     (bind editable-cells :keypress (return-key-pressed saves-edit))))
 
 (defn- create-search-table [parent data]

      (fn [data]
        (log "Received from server:")
        (log-clj data)
        (mark-completed event))
      (fn [& args]
        (jq/add-class $elem "edit-failed")
        (apply alert-error args)
        ))))


  (apply inner args)
  (add-sort-to (first args)))

(defn- set-edit-state [klass event]
  (let [$elem ($ (.-target event))]
    (doseq [c (->> (jq/attr $elem :class) (re-seq #"\S+") (filter #(re-find #"^edit-" %)))]
      (jq/remove-class $elem c))
    (jq/add-class $elem klass)))

(defn- saves-edit [event]
  (.preventDefault event)
