Created
March 16, 2017 16:24
-
-
Save dupuchba/0a3154d9bfaa1b8a1a7e14c3cae9cbf2 to your computer and use it in GitHub Desktop.
This file contains 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
(defui ElementList | |
static om/Ident | |
(ident [this {:keys [id]}] | |
[:list/by-id id]) | |
static om/IQuery | |
(query [this] | |
[:id {:elements (om/get-query Element)}]) | |
Object | |
(render [this] | |
(let [{:keys [id elements]} (om/props this)] | |
(dom/div nil | |
(dom/h4 nil (str "List with id : " id)) | |
(dom/ul #js {:onDragEnter (fn [e] | |
(.preventDefault e)) | |
:onDragOver (fn [e] | |
(set! (.. e -dataTransfer -dropEffect) "move") | |
(.preventDefault e)) | |
:onDrop (fn [e] | |
(.preventDefault e) | |
;; Change our app state | |
)} | |
(map element elements)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment