Created
November 25, 2015 21:16
-
-
Save kurtharriger/abaa0cf4f08027b0b02c to your computer and use it in GitHub Desktop.
DragAndDrop with Library
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
import DragAndDrop exposing (..) | |
import Html exposing (div, p, text) | |
import Html.Attributes exposing (draggable) | |
import Html.Events exposing (onClick) | |
import Signal exposing (foldp) | |
import Color exposing (black) | |
hover = Signal.mailbox False | |
box = p [draggable "true", (onClick hover.address True)] [text "drag-and-drop me"] | |
main = | |
let update m = | |
case (Debug.log "m" m) of | |
_ -> identity | |
in Signal.map (\model -> div [] [box, p [] [text (toString model)]]) | |
(foldp update (0,0) (track False hover.signal)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment