   (when (= 45 (:charCode e)) (event/prevent-default e) (f)))
 
 (event/listen! item-name-field :keypress
-               #(on-plus % (partial quantity-changed :inc false item-name-field)))
+               #(on-plus % (partial quantity-changed :inc item-name-field)))
 
 (event/listen! item-name-field :keypress
-               #(on-minus % (partial quantity-changed :dec false item-name-field)))
+               #(on-minus % (partial quantity-changed :dec item-name-field)))
 
 (defn valid-item-added []
   (when (and (not-empty (d/value item-name-field))

    :inc (inc value)
    :dec (dec value)))

(defn change-quantity [{:keys [item direction remove-on-zero?]}]
  (let [qty (-> item (x/xpath "../../*/input[@rel='qty']"))
        new-value (adjust-quantity direction (to-int (d/value qty)))]
    (if (< 0 new-value)
      (d/set-value! qty new-value)
      (when remove-on-zero?
        (item-deleted item)))))

(defn focus-item-input [& args]
  (.focus item-name-field))

(def basket-saved (pubsub/publishize (fn [b] b) bus))

(def quantity-changed (pubsub/publishize
                       (fn [direction e]
                         {:direction direction
                          :item e}) bus))

(def completed-item (pubsub/publishize (fn [row-id] {:row-id row-id}) bus))
