Skip to content

Instantly share code, notes, and snippets.

@bhenry

bhenry/1old.clj Secret

Last active December 31, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhenry/3856e1889084a52a8db2 to your computer and use it in GitHub Desktop.
Save bhenry/3856e1889084a52a8db2 to your computer and use it in GitHub Desktop.
;;used this way in fermata
(defpartial progress [x y]
(let [responded (progress-percent x y)
unresponded (- 100 responded)
width (fn [v] {:width (str v "%")})]
[:div.progress.progress-striped
[:div.bar.bar-responded {:style (width responded)}]
[:div.bar.bar-unresponded {:style (width unresponded)}]]))
;;had to rewrite it this way in monolith
(defpartial progress [x y]
(let [responded (progress-percent x y)
unresponded (- 100 responded)
width (fn [v] (str "width:" v "%;"))]
[:div.progress.progress-striped
[:div.bar.bar-responded {:style (width responded)}]
[:div.bar.bar-unresponded {:style (width unresponded)}]]))
;;RUNNING IN MONOLITH
;;old renders as
style="{:width "9%"}"
;;new renders as
style="width:9%;"
;;RUNNING IN FERMATA
;;both render as
style="width:9%;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment