Skip to content

Instantly share code, notes, and snippets.

@kurtharriger
Created November 25, 2015 21:16
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 kurtharriger/abaa0cf4f08027b0b02c to your computer and use it in GitHub Desktop.
Save kurtharriger/abaa0cf4f08027b0b02c to your computer and use it in GitHub Desktop.
DragAndDrop with Library
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