Skip to content

Commit

Permalink
Switch the oder of expand-bootstrap-3-fields and expand-bootstrap-3-h…
Browse files Browse the repository at this point in the history
…orizontal-fields.
  • Loading branch information
pupeno committed Aug 22, 2016
1 parent 3b8cd37 commit 2d6214e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/cljs/free_form/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,27 @@
:id id
:placeholder placeholder}]))

(defn- expand-bootstrap-3-horizontal-fields [node]
(defn- expand-bootstrap-3-fields [node]
(if (field? node)
(let [{:keys [type keys extra-validation-error-keys label placeholder options]} (key->keys (second node))
id (clojure.string/join "-" (map name keys))]
[:div.form-group {:free-form/error-class {:keys keys :extra-keys extra-validation-error-keys :error "has-error"}}
[:label.col-sm-2.control-label {:for id} label]
[:div.col-sm-10 (expand-bootstrap-3-input id keys type placeholder options)
[:div.text-danger {:free-form/error-message {:keys keys}} [:p]]]])
[:label.control-label {:for id} label]
(expand-bootstrap-3-input id keys type placeholder options)
[:div.text-danger {:free-form/error-message {:keys keys}} [:p]]])
node))

(defn- expand-bootstrap-3-fields [node]
(defn- expand-bootstrap-3-horizontal-fields [node]
(if (field? node)
(let [{:keys [type keys extra-validation-error-keys label placeholder options]} (key->keys (second node))
id (clojure.string/join "-" (map name keys))]
[:div.form-group {:free-form/error-class {:keys keys :extra-keys extra-validation-error-keys :error "has-error"}}
[:label.control-label {:for id} label]
(expand-bootstrap-3-input id keys type placeholder options)
[:div.text-danger {:free-form/error-message {:keys keys}} [:p]]])
[:label.col-sm-2.control-label {:for id} label]
[:div.col-sm-10 (expand-bootstrap-3-input id keys type placeholder options)
[:div.text-danger {:free-form/error-message {:keys keys}} [:p]]]])
node))


(defn- expand-bootstrap-3-inline-fields [node]
(if (field? node)
(let [{:keys [type keys extra-validation-error-keys label placeholder options]} (key->keys (second node))
Expand Down

0 comments on commit 2d6214e

Please sign in to comment.