Skip to content

Instantly share code, notes, and snippets.

@Will-Sommers
Created May 16, 2014 17:25
Show Gist options
  • Save Will-Sommers/133217a7c71c13836bbc to your computer and use it in GitHub Desktop.
Save Will-Sommers/133217a7c71c13836bbc to your computer and use it in GitHub Desktop.
(om/build-all columns/columns-view (:columns data) {:init-state {:test "test"}})
(defn columns-view [data owner]
(reify
om/IRenderState
(render-state [this {:keys [edit-header? show-input? test]}]
(println (om/get-state owner))
(html [:div.column {:on-mousedown (om/set-state! owner :dragging true)}
(if edit-header?
[:div.column-header
(render-input owner data rename-column (:name data) :edit-header? "header" "Save")]
[:div.column-header {:on-click #(utils/toggle-component-state owner :edit-header?)} (:name data)])
(if (empty? (:cards data))
[:div.empty-column]
(apply dom/div #js {:id "yar"}
(om/build-all cards/card-view (:cards data) {:init-state {:pos 1}})))
[:div {:class (display? show-input?)}
(render-input owner data submit-card "" :show-input? "add-card" "Add")]
[:div
[:a {:on-click #(utils/toggle-component-state owner :show-input?)
:class (display? (not show-input?))} "Add a new card..."]]
[:div
[:a.left "<<"]
[:a.right ">>"]]]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment