Created
May 16, 2014 17:25
-
-
Save Will-Sommers/133217a7c71c13836bbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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